Python Pandas MCQs

11. Python pandas was developed by?

A. Guido van Rossum
B. Travis Oliphant
C. Wes McKinney
D. Brendan Eich

View Answer

12. What will be output for the following code?

import pandas as pd

s = pd.Series([1,2,3,4,5],index = ['a','b','c','d','e'])

print s['a']

A. 1
B. 2
C. 3
D. 4

View Answer

13. What will be correct syntax for pandas series?

A. pandas_Series( data, index, dtype, copy)
B. pandas.Series( data, index, dtype)
C. pandas.Series( data, index, dtype, copy)
D. pandas_Series( data, index, dtype)

View Answer

14. What will be syntax for pandas dataframe?

A. pandas.DataFrame( data, index, dtype, copy)
B. pandas.DataFrame( data, index, rows, dtype, copy)
C. pandas_DataFrame( data, index, columns, dtype, copy)
D. pandas.DataFrame( data, index, columns, dtype, copy)

View Answer

15. Axis 1, in panel represent?

A. minor_axis
B. major_axis
C. items
D. None of the above

View Answer

16. Which of the following thing can be data in Pandas?

A. a python dict
B. an ndarray
C. a scalar value
D. All of the above

View Answer

17. The ________ project builds on top of pandas and matplotlib to provide easy plotting of data.

A. yhat
B. Seaborn
C. Vincent
D. Pychart

View Answer

18. Why ndim is used?

A. Returns the number of elements in the underlying data.
B. Returns the Series as ndarray.
C. Returns the number of dimensions of the underlying data, by definition 1.
D. Returns a list of the axis labels

View Answer

19. What will be output for the following code?

import pandas as pd

import numpy as np

s = pd.Series(np.random.randn(2))

print s.size

A. 0
B. 1
C. 2
D. 3

View Answer

20. Which of the following is false?

A. The integer format tracks only the locations and sizes of blocks of data.
B. Pandas follow the NumPy convention of raising an error when you try to convert something to a bool.
C. Two kinds of SparseIndex are implemented
D. The integer format keeps an arrays of all of the locations where the data are not equal to the fill value

View Answer


* You must be logged in to add comment.