Multiple Choice Question For Python Pandas 1 Class 12 Informatics Practices



1. To create an empty Series object, you can use :

(a) pd.Series(empty)

(b) pd.Series(np.NaN)

(c) pd.Series()

(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, _____ attribute is displayed.

(a) index

(b) size

(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 displayed.

(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)

11. Missing data in Pandas object is represented through:

(a) Null

(b) None

(c) Missing

(d) NaN

12. If a Dataframe is created using a 2D dictionary, then the indexes/row labels are formed from _____.

(a) dictionary's values

(b) inner dictionary's keys

(c) outer dictionary's keys

(d) none of these

13. If a dataframe is created using a 2D dictionary, then the column labels are formed from _____.

(a) dictionary's values

(b) inner dictionary's keys

(c) outer dictionary's keys

(d) none of these

14. The axis 0 identifies a dataframe's _____.

(a) rows

(b) columns

(c) values

(d) datatype

15. The axis 1 identifies a dataframe's _____.

(a) rows

(b) columns

(c) values

(d) datatype

16. To get the number of elements in a dataframe, _____ attribute may be used.

(a) size

(b) shape

(c) values

(d) ndim

17. To get NumPy representation of a dataframe, _____ attribute may be used.

(a) size

(b) shape

(c) values

(d) ndim

18. To get a number representing number of axes in a dataframe, _____ attribute may be used.

(a) size

(b) shape

(c) values

(d) ndim

19. To get the transpose of a dataframe D1, you can write _____.

(a) D1.T

(b) D1.Transpose

(c) D1.Swap

(d) All of these

20. To extract row/column from a datafram, _____ function may be used.

(a) row()

(b) column()

(c) loc()

(d) All of these

21. To display the 3rd, 4th and 5th columns from the 6th to 9th rows of a dataframe DF; you can write _____.

(a) DF.loc[6:9, 3:5]

(b) DF.loc[6:10, 3:6]

(c) DF.iloc[6:10, 3:6]

(d) DF.iloc[6:9, 3:5]

22. To change the 5th column's value at 3rd row as 35 in dataframe DF, you can write _____.

(a) DF[4, 6] = 35

(b) DF[3, 5] = 35

(c) DF.iat[4, 6] = 35

(d) DF.iat[3, 5] = 35

23. Which among the following options can be used to create a DataFrame in Pandas?

(a) A scalar value

(b) An ndarray

(c) A python dict

(d) All of these

24. Identify the correct statement :

(a) The standard marker for missing data in Pandas is NaN.

(b) Series act in a way similar to that of an array

(c) Both (a) and (b)

(d) None of the above

25. To delete a column from a DataFrame, you may use _____ statement.

(a) remove

(b) del

(c) drop

(d) cancel

26. To delete a row from a DataFrame, you may use _____ statement.

(a) remove

(b) del

(c) drop

(d) cancel

27. Which of the following commands is used to install Pandas?

(a) pip install python-pandas

(b) pip install pandas

(c) python install python

(d) python install pandas

28. A two-dimensional labelled array that is an ordered collection of columns to store heterogeneous data types is:

(a) Series

(b) NumPy array

(c) Dataframe

(d) Panel

29. In a dataframe, axis-0 is for

(a) Columns

(b) Rows

(c) Rows and Columns both

(d) None of these

30. Which of the following statements is false?

(a) Dataframe is size-mutable.

(b) Dataframe is values-mutable.

(c) Dataframe is immutable.

(d) Dataframe is capable of holding multiple types of data.

31. Which attribute of dataframe is used to perform the transpose operation on a dataframe?

(a) T

(b) Ndim

(c) Empty

(d) Shape

32. Which attribute of dataframe is used to retrieve its shape?

(a) T

(b) Ndim

(c) Empty

(d) Shape

33. Which attribute of dataframe is used to get number of axis?

(a) T

(b) Ndim

(c) Empty

(d) Shape

34. CSV stands for:

(a) Comma Separated Values

(b) Comma Separated Variables

(c) Column Separated Values

(d) Column Separated Variable

8 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post