CBSE Class 12 Informatics Practices
Question 25 of 40
Practice Paper — Question 7
Back to all questions 7
Question import pandas as pd
di = { 'Corbett' : 'Uttarakhand', 'Sariska' : 'Rajasthan', 'Kanha' :
'Madhya Pradesh', 'Gir' : 'Gujarat' }
NP = pd. Series(di)
print(NP['Sariska'])Rajasthan
import pandas as pd: This line imports the pandas library and assign it the aliaspd.NP = pd.Series(di): This line creates a pandas Series objectNPfrom the dictionarydi.print(NP['Sariska']): This line accesses the value associated with the key 'Sariska' in the Series objectNPand print it. Since the value is 'Rajasthan', it gets printed.