Python Pandas MCQ Questions And Answers

This section focuses on "Python Pandas" for Data Science. These Python Pandas Multiple Choice Questions (MCQ) should be practiced to improve the Data Science skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. Pandas is an open-source _______ Library?

A. Ruby
B. Javascript
C. Java
D. Python

View Answer


2. Python pandas was developed by?

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

View Answer


3. Pandas key data structure is called?

A. Keyframe
B. DataFrame
C. Statistics
D. Econometrics

View Answer


4. 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


5. In pandas, Index values must be?

A. unique
B. hashable
C. Both A and B
D. None of the above

View Answer


6. 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


7. Which of the following is correct Features of DataFrame?

A. Potentially columns are of different types
B. Can Perform Arithmetic operations on rows and columns
C. Labeled axes (rows and columns)
D. All of the above

View Answer


8. 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


9. A panel is a ___ container of data

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

View Answer


10. Axis 1, in panel represent?

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

View Answer


11. Which of the following is true?

A. If data is an ndarray, index must be the same length as data.
B. Series is a one-dimensional labeled array capable of holding any data type.
C. Both A and B
D. None of the above

View Answer


12. 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


13. Which of the following takes a dict of dicts or a dict of array-like sequences and returns a DataFrame?

A. DataFrame.from_items
B. DataFrame.from_records
C. DataFrame.from_dict
D. All of the above

View Answer


14. 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


15. Which of the following makes use of pandas and returns data in a series or dataFrame?

A. pandaSDMX
B. freedapi
C. OutPy
D. Inpy

View Answer


16. 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


17. What will be output for the following code?

import pandas as pd
import numpy as np

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

print s.ndim

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

View Answer


18. 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


19. Which of the following indexing capabilities is used as a concise means of selecting data from a pandas object?

A. In
B. ix
C. ipy
D. iy

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





Discussion


* You must be logged in to add comment.