We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
SREE AYYAPPA PUBLIC SCHOOL, BOKARO
Affiliated to Central Board of Secondary Education, Delhi
ACADEMIC SESSION 2024– 2025 SUMMER ASSIGNMENT CLASS XII INFORMATICS PRACTICES Answer the following Questions Consider the following series object Named ‘Ser’: and answer from Q1 to Q 5 0 578 1 235 2 560 3 897 4 118 What will be the output of following statements?: Q1. print(ser.index) Q2. print(ser.values) Q3. print(ser.shape) Q4. print(ser.size) Q5. print(ser[3]) Find the Error Questions 6 to 9 (Assume that all required packages are imported) Q6. ser = pd.series(range(4)) print(ser) Q7. ser = pd.Series(11,22,33,55, index = range(3)) Q8. l = np.array([‘C’,’C++’,’Java’,’Python’]) s = pd.Series(l,index=[501,502,503,504]) print(s[501,502,504]) Q9. ser = pd.Series(range(1,12,2),index=list(‘pqrst’)) Q10. How to use pandas library in a program? Illustrate the answer with an example. Answer the following Questions Q11. What is Pandas Library of Python? What is its significance? Q12. Write a program to create a Series object using an ndarray that has 5 elements in the range 45 to 80. Q13. Write a program to create a Series object using an ndarray that is created by tilling a list [5, 7] twice. Q14. Write code to create a Series object using the Python sequence [10, 30, 50, 70,90]. Assume that Pandas is imported as alias name pd. Q15. Write a program to create a Series object using individual character ‘p’, ‘y’, ‘t’, ‘h’, ‘o’, and ‘n’. Assume that Pandas is imported as alias name pd. Answer the following Questions Q16. Write a program to create a Series object using six different words : ‘I’, ‘am’, ‘student’, ‘of’, ‘SAPS’. Assume that Pandas is imported as alias name pd. Q17. Consider the Series object ser1 that stores the contribution of each section, as shown below: A 7500 B 9500 C 6892 D 7800 E 5600 Write code to modify the amount of Section ‘B as 10700 and for the section ‘D’ and ‘E’ as 9200. Print the changed object. Q18. Find the output of the following code import pandas as pd ser=pd.Series([578,235,560,897,118]) print(ser[2:]) print(ser[0:3]) print(ser[: :-1]) Q19. Write the output of the following code ser = pd.Series(range(1,10)) ser.head(4) ser.tail() ser.head() Q20. What is a panda series? Explain with a suitable example. Answer the following Question Q21. How to create a series with an example: A python sequence, NumPy Array, A dictionary, A scalar value Q22. Explain the attributes of the series object with an example. Q23. Write the output of the following code fruits = [‘Apple’,’Mango’, ‘Banana’, ‘Grapes’] r2019 = pd.Series([100,80,30,60], index = fruits) r2020 = pd.Series([150,100,50,80], index = fruits) print (“Difference:”) print (r2020 – r2019) r2020 = r2019 + 100 print (r2020) Q24. What is a panda series? Explain with a suitable example. Q25. Write a program to find the leap year.