PDF 20230708 071434 0000
PDF 20230708 071434 0000
PDF 20230708 071434 0000
homework
Arsh
List of programs :
1. Write code to create a Series object using the Python sequence
(4,6,8,10).Assume that Pandas is imported as alias name pd.
3. Write a program to create a Series object using a dictionary that stores the
number of students in each section of class 12 in your school.
4. Write a program to create a Series object that stores the initial budget
allocated(50000/each) for the four quarters of year: Qtri,Qtr2,Qtr3,Qt4.
5. Consider the Series object s13 that stores the contribution of each section,
as shown below:
A 6700
B 5600
C 5000
D 5200
7. Given a dictionary that stores the section names' list as value for 'Section'
key and contribution amounts' list as value for 'Contri' key, Create a
dataframe: Dict1=('Section': ['A', 'B','C','D'], "Contri":
[16700,5600,5000,5200])
import numpy as np
arr1 = np.array([11,12],[13,14],[15,16]].np.int32)
dtf2 = pd.DataFrame(arr1)
print(dtf2)
12. Create a DataFrame namely aid that stores the aid by NGOs for different
states
Andhra
7916 6189 610
Pradesh
13. From the above data frame write a program to display the aid for Books and
Uniform only
14. From the above data frame write a program to display the aid for Uniform
only
15. In Question no 12 add a new column named laptop with data 300,400.
Target Sales
18. Consider the saleDf shown above.Write the code to add column names
'Targeted' and 'Achieved' respectively.
19. Write the code to Select the data from zoneC Row.
#output
Ques2. Code :
#output
Ques3. Code :
Ques4. Code :
#output
Ques5. Code :
#output