0% found this document useful (0 votes)
19 views4 pages

Cbse Xii Ip

The document contains a series of short-type questions related to the Python Pandas library, including definitions, differences between data structures, and code syntax. It also includes case study-based questions requiring code completion for data analysis and visualization tasks using Pandas and Matplotlib. Additionally, there are multiple-choice questions testing knowledge of Series objects and their attributes.

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

Cbse Xii Ip

The document contains a series of short-type questions related to the Python Pandas library, including definitions, differences between data structures, and code syntax. It also includes case study-based questions requiring code completion for data analysis and visualization tasks using Pandas and Matplotlib. Additionally, there are multiple-choice questions testing knowledge of Series objects and their attributes.

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CBSE-XII

Short type question (10x1=10)

1. What is pandas ?
2. Write a full name of pandas.
3. Why you need to use pandas ?
4. Difference between Data Frame and Data Series .
5. How can you import pandas library ?
6. Which function of pandas is use to create a series object ?
7. Write the syntax of series .
8. How to create an empty Series object in python pandas?
9. How to create a non- empty Series object in python pandas?
10. Write three functions name ,which can be use to create an NumPy Array.

CASE STUDY BASED QUESTIONS (5X2=10)

Q.1. Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and Matplotlib for
the same. He got a dataset of the passengers for the year 2010 to 2012 for January, March and
December. His manager wants certain information from him, but he is facing some problems. Help him
by answering few questions given below:

Code to create the above data frame

import pandas as ____________ #Statement 1 data={"Year":[2010,2010,2012,2010,2012],"Month":


["Jan","Mar","Jan","Dec","Dec"] ,"Passengers":[25,50,35,55,65]}
df=pd.____________________(data) #Statement 2
print(df
i. Choose the right code from the following for statement 1.

i. pd ii. df iii. data iv. p

ii. Choose the right code from the following for the statement 2.

i. Dataframe ii. DataFrame iii. Series iv. Dictionary

iii. Choose the correct statement/ method for the required output:

(5,3)

i. df.index ii. df.shape() iii. df.shape iv. df.size

iv. He wants to print the details of "January" month along with the number of passengers,
Identify the correct statement:
i. df.loc[['Month','Passengers']][df['Month']=='Jan']

ii. df[['Month','Passengers']][df['Month']=='Jan']

iii. df.iloc[['Month','Passengers']][df['Month']=='Jan']

iv. df(['Month','Passengers']][df['Month']=='Jan')

v. Mr. Ankit wants to change the index of the Data Frame and the output for the same is given
below. Identify the correct statement to change the index.

i. df.index[]=["Air India","Indigo","Spicejet","Jet","Emirates"]

ii. df.index["Air India","Indigo","Spicejet","Jet","Emirates"]

iii. df.index=["Air India","Indigo","Spicejet","Jet","Emirates"]

iv. df.index()=["Air India","Indigo","Spicejet","Jet","Emirates"]

Q.2. Mr. Sharma is working in a game development industry and he was comparing the given
chart on the basis of the rating of the various games available on the play store. (5X2)

He is trying to write a code to plot the graph. Help Mr. Sharma to fill in the blanks of the code and
get the desired output.
i. Choose the right code from the following for statement 1.
i. matplotlib as plt ii. pyplot as plt iii. matplotlib.pyplot as plt iv. matplotlib.plt as pyplot
ii. Identify the name of the function that should be used in statement 2 to plot the above graph.
i. line() ii. bar() iii. hist() iv. barh()
iii. Choose the correct option for the statement 3.
i. title("Rating") ii. ytitle("Rating") iii. ylabel("Rating") iv. yaxis("Rating")
iv. Choose the right function/method from the following for the statement 4.
i. display() ii. print() iii. bar() iv. show()
v. In case Mr. Sharma wants to change the above plot to the any other shape, which statement,
should he change.
i. Statement 1 ii. Statement 2 iii. Statement 3 iv. Statement 4
OBJECTIVE TYPE QUESTIONS [1 Mark] Multiple Choice Questions (10)
1. To create an empty Series object, you can use:
(a) pd.Series(empty) (b) pd.Series( ) (c) pd.Series(np.NaN) (d) all of these
2. To specify datatype int16 for a Series object, you can write :
(a) pd.Series(data = array, dtype = int16) (b) pd.Series(data = array, dtype = numpy.int16)
(c) pd.Series(data = array.dtype pandas.int16) (d) all of the above
3. To get the number of dimensions of a Series object,
(a) index (b) size attribute is displayed. (c) itemsize (d) ndim
4. To get the size of the datatype of the items in Series object, you can display attribute.
(a) index (b) size (c) itemsize (d) ndim
5. To get the number of elements in a Series object, attribute may be used.
(a) index (b) size (c) itemsize (d) ndim
6. To get the number of bytes of the Series data, attribute is displayed.
(a) hasnans (b) nbytes (c) ndim (d) dtype
7 .To check if the Series object contains NaN values, attribute is displayd.
(a) hasnans (b) nbytes (c) ndim (d) dtype
8. To display third element of a Series object S, you will write
(a) S[:3] (b) S[2] (c) S[3] (d) S[:2]
9. To display first three elements of a Series object S, you may write
(a) S[:3] (b) S[3] (c) S[3rd] (d) all of these
10. To display last five rows of a Series object S, you may write
(a) head() (b) head(5) (c) tail( ) (d) tail(5)

You might also like