0% found this document useful (0 votes)
18 views1 page

Data Handling Using Pandas Super 10 SET B

Python using data

Uploaded by

hardikborawar123
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
18 views1 page

Data Handling Using Pandas Super 10 SET B

Python using data

Uploaded by

hardikborawar123
Copyright
© © All Rights Reserved
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/ 1

SET B

LUCKY BAL NIKETAN SR. SEC. SCHOOL, KNN, JODHPUR


SUBJECT: IP
CLASS: XII
TIME: 1 HOUR M.M.:30

1. Which of the following statement will install pandas library in python?


a) Pip install pand as pd b) pip install pandas as pd
c) pip install pandas.pd d) pip install pandas
2. Given a Pandas series called HEAD, the command which will display the first 3 rows is ______.
a) print(HEAD.head(3)) b) print(HEAD.Heads(3))
c) print(HEAD.heads(3)) d) print(head.HEAD(3))
3. To create an empty Series object, you can use:
a) pd.Series(empty) b) pd.Series( ) c) pd.Series(np.NaN) d) pd.Series(None)
4. To display First 15 rows of a series object ‘Ser1’, you may write:
a) Ser1.tail(15) b) Ser1.head() c) Ser1.head(15) d) Ser1.tail()
5. In Pandas which of the following dataframe attribute can be used to know the number of rows and columns in
a dataframe?
a) size b) index c) count d) shape

6. Shiv wants to know various ways to create a series. Suggest any four ways to create a series for him? 3
7. What are the various ways of accessing series elements? 3
8. What is Matplolib library? Explain in short. 3
9. What do you mean by Pandas? What are three important data structures of pandas? 3
10. Differentiate between NumPy and Pandas? 3
11. What will be the output of the following code: 5
import pandas as pd
mydata=pd.Series( *‘Delhi’, ‘Mumbai’, ‘Kolkata’, ‘Ahmedabad’+ )
print(mydata < ‘Baroda’ )
OR
Explain loc() and iloc() function using example?

12. Carefully observe the following code: 5


import pandas as pd
L=[['XIIC01','Nishtha',65,67],['XIIC02','Rohit',56,54],['XIID04','Laksh',37,43],['XIID05','Krishn',45,4 8]]
df=pd.DataFrame (L, columns=['ID','Name','PB1','PB2'])
print(df)
i. Write a statement to display the average of Preboard 1 and Preboard 2 marks.
ii. Write a statement to display the difference between Preboard 1 and Preboard 2 marks.
Or

Carefully observe the following code:


import pandas as pd
xiic = {'Arnavee':[34,59], 'Samira':[27,38], 'Ayush':[37,55]}
df = pd.DataFrame(xiic,index=['PT1','PT2'])
print(df)
What will be the output of following:
i) print(df.dtypes)
ii) print(df.axes)

You might also like