Cbse Xii Ip
Cbse Xii Ip
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.
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:
ii. Choose the right code from the following for the statement 2.
iii. Choose the correct statement/ method for the required output:
(5,3)
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"]
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)