Olete.in
Articles
Mock Tests
🧪 Panda MCQ Quiz Hub
Pandas MCQ
Choose a topic to test your knowledge and improve your Panda skills
1. Which of the following are modules/libraries in Python?
NumPy
Pandas
Matplotlib
All of the above
2. Important data structure of pandas is/are ____
Series
Data Frame
Both of the above
None of the above
3. Which of the following library in Python is used for plotting graphs and visualization.
Pandas
NumPy
Matplotlib
None of the above
4. _____ is used when data is in Tabular Format.
NumPy
Pandas
Matplotlib
All of the above
5. Which of the following command is used to install pandas?
pip install pandas
install pandas
pip pandas
None of the above
6. Which of the following statement is wrong?
We can create Series from Dictionary in Python.
Keys of dictionary become index of the series.
Order of indexes created from Keys may not be in the same order as typed in dictionary.
All are correct
7. The data label associated with a particular value of Series is called its ______________
Data value
Index
Value
None of the above
8. Write the output of the following : >>> import pandas as pd >>> series1 = pd.Series([10,20,30]) >>> print(series1)
Output: 0 10 1 20 2 30 dtype: int64
Output: 10 20 30 dtype: int64
Output: 0 1 2 dtype: int64
None of the above
9. How many values will be there in array1, if given code is not returning any error? >>> series4 = pd.Series(array1, index = [“Jan”, “Feb”, “Mar”, “Apr”])
1
2
3
4
10. When we create a series from dictionary then the keys of dictionary become ______________
Index of the series
Value of the series
Caption of the series
None of the series
11. Write the output of the following : >>> S1=pd.Series(14, index = ['a', 'b', 'c']) >>> print(S1)
a 14 b 14 c 14 dtype: int64
a 14 dtype: int64
Error
None of the above
12. Which of the following statement is correct for importing pandas in python?
import pandas
import pandas as pd
import pandas as pds
All of the above
13. Python libraries contain a collection of built-in ___________
Data
Modules
Packages
Data Structure
14. columns b. index c. dtypes d. values
ignore_index_val
ignore_index_value
ignore_index
None of the above
15. Which of the following is used to display first 2 rows of DataFrame ‘DF’?
DF.head( )
DF.header(2
DF.head(2)
None of the above
16. Following statement will display ___________ rows from DataFrame ‘DF1’. >>> DF1.head()
All
2
3
5
17. Which property of dataframe is used to check that dataframe is empty or not?
isempty
IsEmpty
empty
Empty
18. Write the output of the statement >>>df.size , if df has the following structure: Name Class Rollno 0 Amit 6 1 1 Anil 7 2 2 Ravi 8 3
9
12
6
. None of the above
19. Parameters of read_csv( ) function is _____
sep
header
Both of the above
None of the above
20. Which of the following function is used to load the data from the CSV file into a DataFrame?
read.csv( )
readcsv( )
read_csv( )
Read_csv( )
21. The default value for sep parameter is ___
comma
semicolon
space
None of the above
22. Write statement to display the row labels of ‘DF’.
DF.Index
DF.index( )
DF.index
DF.row_index
23. Display first row of dataframe ‘DF’
print(DF.head(1))
print(DF[0 :
print(DF.iloc[0 : 1])
All of the above
24. Display last two rows from dataframe ‘DF
’ a. print(DF[-2 : -1])
print(DF.iloc[-2 : -1])
print(DF.tail(2))
All of the above
25. Write statement to transpose dataframe DF.
DF.T
DF.transpose
DF.t
DF.T( )
26. Write statement to display first two columns of dataframe ‘DF’.
DF[DF.columns[ 0 : 2 ] ]
DF.columns[ 0 : 2 ]
Both of the above
None of the above
27. Display last two rows from dataframe ‘DF’
a. print(DF[-2 : -1])
print(DF.iloc[-2 : -1])
print(DF.tail(2))
All of the above
28. Write statement to display the data types of each column of dataframe ‘DF’
DF.types( )
DF.dtypes
DF.dtypes( )
None of the above
29. Write statement to display the dimension of dataframe ‘DF’.
F.dim
DF.ndim
DF.dim( )
None of the above
30. Write statement to display the shape of dataframe ‘DF’.
DF.Shape
DF.shape
DF.shapes
DF.Shapes
Submit