0% found this document useful (0 votes)
23 views

Week -1 Assignment-1

Uploaded by

samrat.s.b729
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Week -1 Assignment-1

Uploaded by

samrat.s.b729
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

School of Computer Science Engineering and Technology

Course- BTech Type- Core


Course Code- CSEL301 Course Name-AIML
Year- 2023 Semester- Odd
Date- 07-08-2023 to 11-08-2023 Batch- 5th Sem

Max. Marks: 3
LAB ASSIGNMENT - #1

Objective: To understand the basic library functions and find out the best fit line using LSM.

NUMPY

1. Import numpy as np and see the version.


2. Write program for Creating a 1D array and extract items contains only odd/ even numbers from 1D
array.
3. Write program for Creating a Boolean array.
4. Write program for Replace items that satisfy any condition with another value in array? (e.g., replace
the odd/ even items with -1)
5. Write program for reshape an array and convert a 1D array to a 2D array.
6. Write program for stacking two arrays vertically?
7. How to remove items from one array those items that exist in another?
8. Write program to get the positions where elements of two arrays match?
9. Using Numpy, import a dataset keeping the text intact and print first 3 rows of the dataset.

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

Least Square Method

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.

ii. Plot the best-fitted line using least square method


iii. Estimate the performance rating for a Faculty with 20 years of experience.

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.

Man hours 3.5 4.5 6.5 7.5 8.5


Productivity(units) 9 10.2 11.6 12.1 20.7

i. Find out the value of a and b.


ii. Plot the best-fitted line using least square method.

You might also like