Week -1 Assignment-1
Week -1 Assignment-1
Max. Marks: 3
LAB ASSIGNMENT - #1
Objective: To understand the basic library functions and find out the best fit line using LSM.
NUMPY
PANDAS:
1. Create a program that reads a csv file from a specified source and prints the first 5 rows using the pandas
library.
2. Write a program to select a particlar series from diamonds DataFrame. Print the content of the series.
3. Write a program to select a particular series from diamonds DataFrame. Print the content of the series.
4. Create a new 'Quality-color' Series of diamond DataFrame by combing any two columns of the
dataframe.
5. Create a program to determine the number of rows and columns, as well as the data type, of each column
in the diamonds Dataframe.
6. Create a program that summarises only the diamonds Dataframe's 'object' columns.
7. Create a program to count the number of missing values in each Series of diamonds DataFrame.
8. Create a program to drop a row if any or all values in a row are missing of diamonds DataFrame on two
specific columns
School of Computer Science Engineering and Technology
1. Consider the following example: Experience of faculties in a university (number of years) and their
performance rating is given.
Exp. in years 16 12 18 4 3 10 5 12
Performance 87 88 89 68 78 80 75 83
rating
i. Find and print the slope and intercept by least square method.
Additional questions
1. Number of man-hours and the corresponding productivity (units) are given below. Fit a simple linear
regression equation ˆY = a + bx applying the method of least squares.