Panda/Pandas MCQ Sample Test,Sample questions

Question:
 Which of the following are modules/libraries in Python?

1.NumPy

2.Pandas

3.Matplotlib

4.All of the above


Question:
columns

b. index

c. dtypes

d. values

1.ignore_index_val

2.ignore_index_value

3. ignore_index

4.None of the above


Question:
Display first row of dataframe ‘DF’

1.print(DF.head(1))

2.print(DF[0 :

3.print(DF.iloc[0 : 1])

4.All of the above


Question:
Display last two rows from dataframe ‘DF

1.’ a. print(DF[-2 : -1])

2.print(DF.iloc[-2 : -1])

3.print(DF.tail(2))

4.All of the above


Question:
Display last two rows from dataframe ‘DF’

1. a. print(DF[-2 : -1])

2. print(DF.iloc[-2 : -1])

3. print(DF.tail(2))

4.All of the above


Question:
Following statement will display ___________ rows from DataFrame ‘DF1’.
>>> DF1.head()

1.All

2.2

3.3

4.5


Question:
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.1

2.2

3.3

4.4


Question:
Important data structure of pandas is/are ____

1.Series

2.Data Frame

3.Both of the above

4.None of the above


Question:
Parameters of read_csv( ) function is _____

1.sep

2.header

3.Both of the above

4.None of the above


Question:
Python libraries contain a collection of built-in ___________

1.Data

2.Modules

3.Packages

4.Data Structure


Question:
The data label associated with a particular value of Series is called its ______________

1.Data value

2.Index

3.Value

4.None of the above


Question:
The default value for sep parameter is ___

1.comma

2.semicolon

3.space

4. None of the above


Question:
When we create a series from dictionary then the keys of dictionary become ______________

1.Index of the series

2.Value of the series

3.Caption of the series

4.None of the series


Question:
Which of the following command is used to install pandas?

1.pip install pandas

2.install pandas

3.pip pandas

4.None of the above


Question:
Which of the following function is used to load the data from the CSV file into a DataFrame?

1.read.csv( )

2. readcsv( )

3.read_csv( )

4.Read_csv( )


Question:
Which of the following is used to display first 2 rows of DataFrame ‘DF’?

1.DF.head( )

2.DF.header(2

3.DF.head(2)

4.None of the above


Question:
Which of the following library in Python is used for plotting graphs and visualization.

1.Pandas

2.NumPy

3.Matplotlib

4.None of the above


Question:
Which of the following statement is correct for importing pandas in python?

1. import pandas

2.import pandas as pd

3.import pandas as pds

4.All of the above


Question:
Which of the following statement is wrong?

1.We can create Series from Dictionary in Python.

2. Keys of dictionary become index of the series.

3.Order of indexes created from Keys may not be in the same order as typed in dictionary.

4.All are correct


Question:
Which property of dataframe is used to check that dataframe is empty or not?

1.isempty

2.IsEmpty

3.empty

4.Empty


Question:
Write statement to display first two columns of dataframe ‘DF’.

1.DF[DF.columns[ 0 : 2 ] ]

2. DF.columns[ 0 : 2 ]

3.Both of the above

4.None of the above


Question:
Write statement to display the data types of each column of dataframe ‘DF’

1.DF.types( )

2.DF.dtypes

3. DF.dtypes( )

4.None of the above


Question:
Write statement to display the dimension of dataframe ‘DF’.

1.F.dim

2.DF.ndim

3.DF.dim( )

4.None of the above


Question:
Write statement to display the row labels of ‘DF’.

1.DF.Index

2.DF.index( )

3.DF.index

4.DF.row_index


Question:
Write statement to display the shape of dataframe ‘DF’.

1.DF.Shape

2.DF.shape

3.DF.shapes

4.DF.Shapes


Question:
Write statement to transpose dataframe DF.

1.DF.T

2. DF.transpose

3.DF.t

4. DF.T( )


Question:
Write the output of the following :
>>> import pandas as pd 

>>> series1 = pd.Series([10,20,30])

>>> print(series1)

1.Output: 0 10 1 20 2 30 dtype: int64

2.Output: 10 20 30 dtype: int64

3.Output: 0 1 2 dtype: int64

4.None of the above


Question:
Write the output of the following :
>>> S1=pd.Series(14, index = ['a', 'b', 'c'])
>>> print(S1)

1.a 14 b 14 c 14 dtype: int64

2.a 14 dtype: int64

3.Error

4.None of the above


Question:
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

1. 9

2.12

3.6

4.. None of the above


Question:
_____ is used when data is in Tabular Format.

1.NumPy

2.Pandas

3.Matplotlib

4.All of the above


More MCQS

  1. Pandas MCQ
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!