Ip Practical File
Ip Practical File
FILE
NAME: SHREYA KATHAIT
CLASS: 12-D
ROLL NO.: 33
Session- 2022-23
CERTIFICATE
Sign of Teacher
ACKNOWLEDGEMENT
Sign of Teacher
TABLE OF CONTENTS
No Practical Signature
17 Create a series of your choice with 10 vales and find the sum of
those values which are ending with 3 or 5.
18 Create a series and give appropriate index name and series name.
CODE:
OUTPUT:
2. Write a Pandas program to add and subtract any two Pandas
Series.
CODE:
OUTPUT:
3. Write a Pandas program to multiply and divide any two Pandas
Series.
CODE:
OUTPUT:
OUTPUT:
5. Create a series and print the last 3 elements of series using the tail
function.
CODE:
OUTPUT:
6. Create a series and print the first n elements of series using the
head function. Take n from user
CODE:
OUTPUT:
7. Create a dataframe named as students using a list of names of 5
students
CODE:
OUTPUT:
OUTPUT:
9. Create a dataframe countries using a dictionary which
stores country name, capitals and populations of the country.
CODE:
OUTPUT:
OUTPUT:
12. From the dataframe in question 11, show the data of Ramit
and Mallika where they both have scored more than 90. ( Boolean
indexing )
CODE:
OUTPUT:
13. Create the following DataFrame Sales containing year wise sales
figures for five sales persons in INR. Use the years as column
labels, and sales person names as row labels.
2014 2015 2016 2017
Madhu 700 700 5000 700
Kusum 2100 2100 2100 2150
Kinshuk 1300 1310 1350 1370
Ankit 878 878 878 878
Shruti 987 978 977 987
Display the shape and size of Sales
CODE:
OUTPUT:
14. Add the following data in the above dataframe for year 2018
Madhu 160000,
Kusum 110000,
Kinshuk 500000,
Ankit 340000,
Shruti 900000
CODE:
OUTPUT:
15. From the dataframe in question 8, Display the batsman details who
scored (Boolean indexing)
• More than 2000 in ODI
• Less than 2500 in Test
• More than 1500 in T20
CODE:
OUTPUT:
16. Write a program to display all the elements greater than 100
from a Series
CODE:
OUTPUT:
17. Create a series of your choice with 10 vales and find the sum
of those values which are ending with 3 or 5.
CODE:
OUTPUT:
18. Create a series and give appropriate index name and series
name.
CODE:
OUTPUT:
19. Write a Pandas program to create a series from a list shows the
attributes of series.
(values, index, size, shape, dtype, empty, hasnans)
CODE:
OUTPUT:
20. Create a series of 10 numbers starting with 41 and with
the increment of 3. Now add 7 all odd values and subtract 3 in
even values. Reprint the updated series.
CODE:
OUTPUT:
Part 2 Data Visualization
1. Given the following data of rainfall in different zones of India in mm
for 12 months, Create multiple lines chart in a figure to observe
any trends from Jan to Dec.
Zones|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
North|14 | 13 | 13 | 19 | 16 | 20 | 15 | 17 | 19 | 17|15 | 12|
South| 16 | 20 | 13 | 20 | 20 | 17 | 11 |16 | 13 |14 | 17| 20|
CODE:
OUPUT:
2. Write a program to plot a histogram of ages of 80 participants in
some game from given data with 6 bins of your choice.
Data = [ 9,10,11,13,13,15,16,17,18,19,21,23,23,23,24,24,25, 25,25,
25,25,26, 26,27,27,27,27,29,30,30,30,30,31,33,34,34,35, 36,36,37,
37,37,38,39,40,40, 40,41,42,43,43,39,30,31,32,33,34,35,36,37,
38,39,36,37,38,40,41,42,43, 44,45, 50,51,52,53,54,55,56,57,58]
CODE:
OUTPUT:
3. Consider the following data of a medical store and plot the data on
the bar chart and Customize the chart as you wish:
Month Masks Sanitizer Hand wash
March 1500 4400 6500
April 3500 4500 5000
May 6500 5500 5800
June 6700 6000 6300
July 6000 5600 6200
CODE:
OUTPUT:
4. Write a program in Python Pandas to create the following DataFrame
“df” from a Dictionary. Draw line charts to show the plotting of
score1 and score 2 for all batsman. Change font size of the titles to
15 and color to green.
CODE:
OUTPUT:
5. Create a histogram of 5 equal bins from the following score of a
test given to students out of 50 marks.
Test-scores 20, 25, 30, 45, 30, 42, 32, 34, 42, 35, 44, 24, 25, 48, 50, 39,
38, 50, 27, 49, 22, 24, 26, 27, 30, 38, 34, 40, 35, 47, 41, 44, 49, 45, 48,
44
CODE:
OUPUT:
6. Consider the data given below. Create a bar chart depicting the
downloads of the app.
CODE:
OUTPUT: