Google News
logo
Pandas - Quiz(MCQ)
A)
Panel Data
B)
Panel Dashboard
C)
Panel Data analyst
D)
Panel Data Analysis

Correct Answer : Option (A) :   Panel Data


Explanation : pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series. The name is derived from the term "Panel Data", an econometrics term for data sets that include observations over multiple time periods for the same individuals. Its name is a play on the phrase "Python data analysis" itself.

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

Correct Answer : Option (C) :   Wes McKinney


Explanation : Pandas is a Python library for data analysis. Started by Wes McKinney in 2008 out of a need for a powerful and flexible quantitative analysis tool, pandas has grown into one of the most popular Python libraries.

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

Correct Answer : Option (D) :   pandas.Series( data, index, dtype, copy)

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)

Correct Answer : Option (D) :   pandas.DataFrame( data, index, columns, dtype, copy)

A)
Java
B)
Python
C)
jQuery
D)
Javascript

Correct Answer : Option (B) :   Python

A)
unique
B)
hashable
C)
Both (a) and (b)
D)
None of the above

Correct Answer : Option (C) :   Both A and B

A)
DataFrame
B)
KeyFrame
C)
Statistics
D)
Econometrics

Correct Answer : Option (A) :   DataFrame

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

Correct Answer : Option (D) :   All of the above

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

Correct Answer : Option (B) :   DataFrame.from_items

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

Correct Answer : Option (C) :   freedapi

A)
Pandas
B)
Math
C)
Random
D)
None of the above

Correct Answer : Option (A) :   Pandas

A)
NumPy
B)
Matplotlib
C)
Pandas
D)
None of the above

Correct Answer : Option (B) :   Matplotlib

A)
float
B)
String
C)
integer
D)
All of the above

Correct Answer : Option (D) :   All of the above

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

Correct Answer : Option (D) :   0

A)
S1 = pd.Series( )
B)
S1 = pd.Series(None)
C)
Both of the above
D)
None of the above

Correct Answer : Option (C) :   Both of the above

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

Correct Answer : Option (A) :   1

17 .
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)
1
B)
2
C)
3
D)
4

Correct Answer : Option (B) :   2

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

Correct Answer : Option (D) :   Returns the number of dimensions of the underlying data, by definition 1.

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

Correct Answer : Option (A) :   Seaborn


Explanation : Seaborn has great support for pandas data objects.

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

Correct Answer : Option (D) :   All of the above


Explanation : The passed index is a list of axis labels.

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

Correct Answer : Option (B) :   major_axis


Explanation : major_axis : axis 1, it is the index (rows) of each of the DataFrames.

A)
Series
B)
Data Frame
C)
Both (a) and (b)
D)
None of the above

Correct Answer : Option (A) :   Series

A)
Data
B)
Value
C)
Index
D)
None of the above

Correct Answer : Option (C) :   Index

A)
Bokeh
B)
Statsmodels
C)
Seaborn
D)
None of the above

Correct Answer : Option (B) :   Statsmodels


Explanation : Bokeh is a Python interactive visualization library for large datasets that natively uses the latest web technologies.

A)
read_hdf
B)
read_json
C)
read_pickle
D)
read_csv

Correct Answer : Option (D) :   read_csv

A)
Panel
B)
DataFrame
C)
Character Vector
D)
All of the above

Correct Answer : Option (B) :   DataFrame


Explanation : You get columns out of a DataFrame the same way you get elements out of a dictionary.

A)
yhat
B)
Vincent
C)
Seaborn
D)
None of the above

Correct Answer : Option (A) :   yhat

A)
PyData
B)
PyDatastream
C)
Quandl
D)
None of the above

Correct Answer : Option (C) :   Quandl

A)
merge function
B)
read_csv function
C)
apply function
D)
pivot_table function

Correct Answer : Option (C) :   apply function

A)
SArray
B)
SparseArray
C)
PyArray
D)
None of the above

Correct Answer : Option (B) :   SparseArray


Explanation : SparseArray is a 1-dimensional ndarray-like object storing only values distinct from the fill_value.

A)
print(exp.axes())
B)
print(exp.index())
C)
print(exp.index)
D)
print(exp.axes)

Correct Answer : Option (D) :   print(exp.axes)

A)
df = pd.DataFrame(dict1)
B)
df = pd.Dataframe(dict1)
C)
df = pd.dataFrame(dict1)
D)
df = pd.dataframe(dict1)

Correct Answer : Option (A) :   df = pd.DataFrame(dict1)

A)
Blaze
B)
FRED
C)
Geopandas
D)
None of the above

Correct Answer : Option (A) :   Blaze


Explanation : If your work entails maps and geographical coordinates, and you love pandas, you should take a close look at Geopandas.

A)
SparsePanel
B)
SparseSeries
C)
SparseDataFrame
D)
None of the above

Correct Answer : Option (D) :   None of the above


Explanation : SparseArray can be converted back to a regular ndarray by calling to_dense.

A)
to_stata
B)
to_msgpack
C)
to_text
D)
to_clipboard

Correct Answer : Option (C) :   to_text

A)
GeoList
B)
SparseList
C)
SparseSeries
D)
All of the above

Correct Answer : Option (B) :   SparseList

A)
Series.to_coo()
B)
SparseSeries.to_cooser()
C)
SparseSeries.to_coo()
D)
All of the above

Correct Answer : Option (C) :   SparseSeries.to_coo()


Explanation : Experimental api to transform between sparse pandas and scipy.sparse structures.

A)
Union
B)
Total
C)
Intersection
D)
All of the above

Correct Answer : Option (A) :   Union

A)
axes
B)
Size
C)
empty
D)
transpose

Correct Answer : Option (D) :   transpose

A)
exp.iloc[0:2,0:2]
B)
exp.iloc[0:3,0:3]
C)
exp.iloc[1:3,1:3]
D)
exp.iloc[1:4,1:4]

Correct Answer : Option (B) :   exp.iloc[0:3,0:3]

A)
Index
B)
Row
C)
Column
D)
Values

Correct Answer : Option (B) :   Row

A)
print(Book.Author)
B)
print(Book[‘Author’])
C)
Both are True
D)
Both are False

Correct Answer : Option (C) :   Both are true

A)
len(df)
B)
df.len
C)
df.len()
D)
None of the above

Correct Answer : Option (A) :   len(df)

44 .
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)
1
B)
2
C)
3
D)
4

Correct Answer : Option (A) :   Returns the number of dimensions of the object. By definition, a Series is a 1D data structure, so it returns 1.

45 .
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)
4
B)
3
C)
2
D)
1

Correct Answer : Option (D) :   1

46 .
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)
B)
1
C)
2
D)
3

Correct Answer : Option (C) :   2


Explaination : Returns the size(length) of the series.

47 .
What type of error is returned by following code?
 
import pandas as pd
S1 = pd.Series(data = (31, 2, -6), index = [7, 9, 3, 2])
print(S1)
A)
ValueError
B)
IndexError
C)
SyntaxError
D)
None of the above

Correct Answer : Option (A) :   ValueError

48 .
What will be output of given code?

df = pd.DataFrame({‘c1’:[12,34,45],’c2’:[32,21,44],’c3’:[74,41,20]})
print(df.index)
A)
0 1 2
B)
RangeIndex(start=0, stop=3, step=1)
C)
Index([0,1,2 ], dtype=‘int’)
D)
None of the above

Correct Answer : Option (B) :   RangeIndex(start=0, stop=3, step=1)