Class 12 (IP) PT. 01 Answer Key2024-25
Class 12 (IP) PT. 01 Answer Key2024-25
In Pandas,
The describe() is used to view some basic statistical details.
The info() function is used to print a summary of a DataFrame. This method show
information about a DataFrame.
13 Ans:- (2)
pivot_table() :- It does not raise errors for multiple entries of a row, column
combination.
pivot() :- It raise errors for multiple entries of a row, column combination.
14 Ans:- (2)
import pandas as pd
Year1 = {'Q1': 5000, 'Q2': 8000, 'Q3': 12000, 'Q4': 18000}
Year2 = {'A': 13000, 'B': 14000, 'C': 12000}
totSales = {1: Year1, 2: Year2}
df = pd.DataFrame(totSales)
print(df)
15 Ans:- (2)
65 II1
75 III
85 IV
dtype: object
PART-C
16 Ans:- (3)
(a)
>>> sales.iloc[2:7]
(c)
>>> sales.Item[4]
17 Ans:- (3)
(a) wdf.min()
(b) wdf.max(axis=1)
(c) wdf.Rainfall.var()
(d) wdf.tail(10).mean() , wdf.tail(10).mode() , wdf.tail(10).median()
PART-D
18 Import pandas as pd (5)
Import numpy as np
Nmk=mk.fillna({‘A’:20,’B’:10,’C’:30,’D’:0})
Print(nmk)
19 Ans:- (5)
import pandas as pd
import numpy as np
result = pd.DataFrame( { "rollno" : [11, 7, 6, 1, 10, 7,
11], \
"marks" : [11, 12, 13, 14, 15, 16, 17] } )