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

Python prg list practical 2024-25

Uploaded by

useexternal57
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Python prg list practical 2024-25

Uploaded by

useexternal57
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Grade 12.

Practical Record boks


Instructions
● Programs are to be written on the ruled side.
● Output screen shots to be taken, printed and pasted on the white side.
● Complete your SQL first and then write python programs
● Index is MUST.
● Please write neatly

Series
1. Write a python program to create a series with names of the days and print it.
2. Write a python program to create a series using a numpy array of vowels and print the
series
3. Write a python program to create a series from a dictionary storing names of your three
friends(key) and their phone numbers(value). Print the series.
4. Write a python program to create a series of 5 integers and calculate the cubes of the
series elements and print them.
5. Write a python program to create the following series and assign a name to it-Planets

num_moons

mars 4

venus 7

mercury 3

earth 1

neptune 4

uranus 7

saturn 12

jupiter 10

Display the size , datatype, shape and dimension of this series.

6. Write a python program to create two series goals_mat1 and goals_mat2.

goals1

hurricanes 4

champs 7

winners 3
destroyers 1

goals1

hurricanes 4

champs 7

winners 3

A. Add both the series and display the resultant one.


B. Delete champs from goals_mat1
C. Display the first two elements of goals_mat2
D. Update the data of champs in goals_mat2 to 10

11. Write a python program to create two series of 5 integers.


- Add both the series and store them in another series named SUM
- Find the product of the series and store them in another series named PROD
- Display the values from PROD which are greater than 15.

12.write a Python program to create a Series using a list of Marks of 10 students and
display first 5 Students’ marks and Last 2 Students’ marks from the Series object.

Data Frames
13. Consider the following DataFrame- temperature

Dehi Mumbai Hyderabad

Monday 34 27 30

Tuesday 39 21 33

Wednesday 38 20 34

A. Write a Python to create the above mentioned dataframe.


B. Add another column - bangalore with the temperatures as 20, 19, 21
C. Add another row with the data- thursday, 40, 25,33,20
D. Delete the row -Monday
E. Delete the column of delhi
F. Rename the columns to city 1, city 2 and city 3
G. Rename the rows to day 1, day 2, day 3
H. Change the temperature to day 2 to 32, 24, 28
I. Print the temperatures of city 2 for all the days
J. print the temperature of all the cities on day 3
K. Print the temperature of city 2 on day 2
L. Print the data of all those days in city 1 when temperature was > 20
M. Print the data of all those days on day 3 when temperature was <30

14. Write a Python program to create a pandas DataFrame to analyze the number of
Government and Private medical colleges and their Total seats,Fees state wise details using
the dataset available at www.data.gov.in. Also, perform the following operations.

Total seats Free seats fees

AIIMS 78 55 132568

UCMC 44 5 142855

ESI 12 44 110363

(i) Add another row with data LHMC, 34,55,89.


(ii) To display the free seats which are greater than 50
(iv)To display the data of AIIMS and UCMS
(v) To display the fees which are less than 100000

15. Write a Python program to create a dataframe of Employees' with columns Empno, Name,
Salary and save it into an Employee.csv file.

Data Visualization

16.WAP to create the following dataframe- Millets

state jowar bajra ragi

telangana 78 55 78

AP 44 78 55

kerala 12 44 63
a. Create a line graph between states and Ragi with following specifications
- Line color: blue
- Thickness: 10 points
- Display gridlines and appropriate labels on axis and the title
b. Create a bar graph between states and jowar with following specifications
- Bar width: 0.7
- Bar color: red
- Display gridlines and appropriate labels on axis and the title

17. Write a Python program to create a DataFrame for students and marks in 5 subject.Save it
to a CSV file, and then draw a bar chart using Matplotlib for all the subjects. The width of each
bar should be 0.25 and the color should be different for each subject. Additionally, provide a
proper title and axes labels for the bar chart.

18..Write a Python program to plot a Line chart to depict the changing weekly tomato and potato
prices for four weeks. Also, give appropriate axes labels, title and set marker style as Diamond
and marker line color as ‘red’ for tomato and green for potato

19.Write a python program to Collect the minimum and maximum temperature of your city for a
fortnight and present it using a histogram plot. Proper labels, a title and a legend are to be
displayed on the chart.

20. Write a Python program to plot a Line chart to depict the changing yearly trend of sale of I
phones in India.Additionally, provide a proper title and axes labels for the bar chart.

You might also like