0% found this document useful (0 votes)
6 views18 pages

IP PANDAS FILE SAKSHAMm

The document contains a series of programming tasks related to data manipulation using Pandas and data visualization using Matplotlib. It includes commands for summing series, modifying dataframes, reading from CSV files, and plotting various types of charts. Each task is followed by an expected output format, indicating the need for code solutions.

Uploaded by

Harman Kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views18 pages

IP PANDAS FILE SAKSHAMm

The document contains a series of programming tasks related to data manipulation using Pandas and data visualization using Matplotlib. It includes commands for summing series, modifying dataframes, reading from CSV files, and plotting various types of charts. Each task is followed by an expected output format, indicating the need for code solutions.

Uploaded by

Harman Kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

PANDAS

1. Given The Following Series S1 And S2,


Write A Command To Find The Sum Of S1
And S2

S1 S2
A 10 A 80
B 40 B 20
C 34 C 74
D 60 D 90

ANSWER

OUTPUT
2. Consider Two Objects X And Y, Where X Is A
List And Y Is A Series. Both Have Values
20,40,90,110. Find Output Of:
a) print (x*2)
b) print (y*2)
ANSWER
OUTPUT

3. Consider Dataframe Df As Shown Below:


A B D
15 17 19
16 18 20
20 21 22
Add A New Row ‘c’ With Values Being 2, 5, [Nan].
ANSWER
OUTPUT

4. Consider The Following Code And Find It’s


Output.

OUTPUT
5. Consider The Data Frame Below:

i) Add Both Scores And Assign To


Column Total.
ii) ii) Display The Highest Score In From
Score1 And Score2.

ANSWER

OUTPUT
6. Consider the following dataframe, find
the mean and find the sum of the values.

ANSWER
OUTPUT

7. Given a Series that stores are of states


in km. Write code to find the biggest and
smallest three areas from the series.

ANSWER

OUTPUT
8. Given a DataFrame:

Write a program to print only Name, Age and


Position for all rows.

ANSWER

OUTPUT

9. Using the same Dataframe in the previous


question, summarise how many projects
and their positions have the employees
completed.
OUTPUT

PYHTON CSV

10-14

10. Write a program to read from a CSV file


and create a dataframe from it.
ANSWER

OUTPUT
11. Write a program to read from a CSV file
and create a dataframe. The file’s column
header should use column numbers 0,1,2… etc.

ANSWER

OUTPUT

12. Write a program to read from a CSV file and


create a dataframe using Empno as index
labels.
ANSWER
OUTPUT

13. Write a program to read from a CSV file


and create a dataframe, using our own column
heading EmpID, EmpName, Designation and
Salary and also print the maximum salary.
ANSWER

OUTPUT

14. Write a program to read from a CSV file and


create a dataframe, printing the middle row of the
data stored in the csv file.
ANSWER

OUTPUT

15. Consider the data frame all Df as shown below

Write a program to export the contents of the


data frame to a CSV file.
ANSWER
OUTPUT

MATPLOTLIB
16. Write a program to record a
student's performance in 10 unit tests.
ANSWER

OUTPUT
17. Write a program to plot a car chart
from medals won by Australia and India.
ANSWER

OUTPUT
18. Write a program to plot a horizontal bar
chart from the heights of some students.
ANSWER

OUTPUT
19. A survey gathers heights and weights of
100 participants and records the participants'
ages. Write a program to plot histogram from
above data with 20 bins.
ANSWER

OUTPUT
20. Write a program to record no. of online
classes in a dictionary and show it in the form of
a bar graph.
ANSWER

OUTPUT
--THANKYOU--

You might also like