0% found this document useful (0 votes)
81 views21 pages

IP Practical File XII CBSE Suryadatta National School Bhavika Rakesh Roll No. 072

This document contains 15 programming tasks involving data analysis and visualization using Python Pandas and Matplotlib. The tasks include creating and manipulating DataFrames, aggregating and summarizing data, plotting charts like bar plots, histograms, and line charts using different data sources. The tasks require reading data from files or web, performing operations on DataFrames, and generating various visualizations to analyze and observe trends in the data.

Uploaded by

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

IP Practical File XII CBSE Suryadatta National School Bhavika Rakesh Roll No. 072

This document contains 15 programming tasks involving data analysis and visualization using Python Pandas and Matplotlib. The tasks include creating and manipulating DataFrames, aggregating and summarizing data, plotting charts like bar plots, histograms, and line charts using different data sources. The tasks require reading data from files or web, performing operations on DataFrames, and generating various visualizations to analyze and observe trends in the data.

Uploaded by

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

IP Practical File XII CBSE

Suryadatta National School

Bhavika Rakesh

Roll no. 072

1. Write a program that create Series from ndArray. Print all values in the Series
using loop and also print the sliced values from the Series.

output :
2. Write a program that create reads marks in Series and prints the finds average of
marks.
Code along with output :

3. Create a Data Frame quarterly sales where each row contains the item category,
item name, and expenditure. Group the rows by the category and print the total
expenditure per category. (Read 3 values for each category. Total category should
be 4).
Output:

4. Create a data frame for examination result and display row labels, column labels
data types of each column and the dimensions.
Output:

5. Create a DataFrame as shown below and perform following operations on it.


a) Add a new column Total Price that contains Total Price of Product (Total Price
= Quantity * Price)
b) Add a new row to the DataFrame with Data – (Scanner, HP, 2, 9500) c) Display
the Product and Total Price of the DataFrame.

Output :

6. Create a DataFrame that reads Employee Data (Employee No, Name, Address,
Date of Joining, Salary) from CSV File and displays the details.
code and output:

7. Create a DataFrame with details BookID, Book Description, Author, Publisher,


Quantity and Price. Store the data into a CSV File with name “Employee_Data”.
csv created :

8. Consider DataFrame df as shown below :

Write commands to :
a) Write command to calculate minimum value for each of the row from subset of
dataframe that contains age, weight, height, runsscored
b) Write command to calculate mean for last 3 rows.
code:

output:

9. Write a code to create following dataframe.


Do the following:
a) Add column "Total Amount" that calculates total amount of tickets and assign
that to new column.
b) Add a new row with values ( B006 , Vijay, 7, 150, John). Calculate the total
amount of tickets and assign it to Total Amount column.

output :
10. Read the subjects and marks/grades for different subject of Class 12 and plot
column chart on that. Also display title, x-axis and y-axis labels.

Output:
11. Read data from open source (e.g. data.gov.in), aggregate and summarize it.
Then plot it using different plotting functions of the Matplotlib library.
Data used :
Output :
12. Draw the histogram based on the Production of Corn in different Years
'Year':2003,2005,2007,2009,2011,2013,2015,2017,2019,2021
'Production': 7,4,9,19,23,4,16,8,6,25
code:

plot:
13. Observe the given data for Football Players and their goals scored in the
matches. Plot them on the bar chart.
plot:

14. Consider the data given below for creating bar and line chart
a) Create a bar chart to distribution of rainfall from June to Nov for all zones. b)
Create line chart to observe any trends from June to Nov.

Output:
15. Write a program in Python Pandas to create the following DataFrame ‘Library’.

a) Display DataFrame ‘Library’.


b) Display the Book names having price above 350.

Output :

You might also like