- Home
- Subjects
- Data Science
- Pandas
Pandas MCQs · Page 3
83 multiple choice questions with answers in Data Science.
-
A
len(df)
Correct answer
-
B
df.size
-
C
df.columns
-
D
df.ndim
-
A
Count, mean, standard deviation, min, quartiles and max
Correct answer
-
B
Count, mode and frequency for each distinct value present
-
C
Correlation coefficients between all column pairs
-
D
The first five rows sorted by each column
-
A
Drops columns containing any missing value
-
B
Fills missing values with zero
-
C
Reports the count of missing values only
-
D
Drops rows containing any missing value
Correct answer
-
A
A NumPy array holding the column values
-
B
The column's dtype object
-
C
A Series holding that single column
Correct answer
-
D
A DataFrame with one column
-
A
Five randomly sampled rows
-
B
A summary of each column's dtype
-
C
The first five rows of the DataFrame
Correct answer
-
D
The first five columns of the DataFrame
-
A
The column names as an Index object
-
B
(200, 6), a tuple of rows then columns
Correct answer
-
C
(6, 200), a tuple of columns then rows
-
D
1200, the total number of values stored
-
A
df.order_by('marks', ascending=False)
-
B
df.rank_values('marks', ascending=False)
-
C
df.sort_values('marks', ascending=False)
Correct answer
-
D
df.sort_index('marks', ascending=False)
-
A
Only columns free of NaN
-
B
Only the numeric columns
Correct answer
-
C
Every column including text
-
D
Only the index entries
-
A
qcut only handles datetime data
-
B
cut always makes equal-size bins
-
C
qcut bins by quantile; cut by values
Correct answer
-
D
qcut bins by value; cut by quantile
-
A
Null
-
B
True
-
C
False
-
D
None
Correct answer
-
A
The sum
-
B
The count
-
C
The maximum
-
D
The mean
Correct answer
-
A
Ranks x without reordering rows
-
B
Sorts rows by x, largest first
Correct answer
-
C
Sorts columns by x, largest first
-
D
Drops rows where x is negative
-
A
concat joins frames on shared keys
-
B
merge stacks frames along an axis
-
C
merge needs identical column names
-
D
concat stacks frames along an axis
Correct answer
-
A
It reorders the index of the frame
-
B
The inner selection may be a copy
Correct answer
-
C
It always raises a KeyError
-
D
It silently converts dtypes to object
-
A
One row as a Series
Correct answer
-
B
One column as a Series
-
C
The whole DataFrame
-
D
A single scalar cell
-
A
By count, lowest first
-
B
By the index labels
-
C
By original row order
-
D
By count, highest first
Correct answer
-
A
Duplicate rows in each column
-
B
Bytes of memory per column
-
C
Missing counts for each column
Correct answer
-
D
Total entries in each column
-
A
The memory used in bytes
-
B
The dtype of every column
-
C
The count of non-null entries
-
D
The number of rows and columns
Correct answer
-
A
Drops columns holding any missing value
-
B
Fills every missing value with zero
-
C
Drops repeated index entries
-
D
Drops rows holding any missing value
Correct answer
-
A
A ValueError, because the indexes are not identical
-
B
A Series indexed 1 to 4, with zeros at 1 and 4
-
C
A Series indexed 1 to 4, with NaN at 1 and 4
Correct answer
-
D
A Series of length 3, added element-wise by position
-
A
loc works only on Series objects
-
B
iloc works only on numeric columns
-
C
loc uses labels; iloc uses positions
Correct answer
-
D
loc uses positions; iloc uses labels
-
A
The first five rows
Correct answer
-
B
The last five rows
-
C
Five randomly chosen rows
-
D
The five largest values
-
A
save_csv()
-
B
export_csv()
-
C
to_csv()
Correct answer
-
D
write_csv()
-
A
filter rows by a given condition
-
B
rename the columns of a DataFrame
-
C
calculate summary statistics for columns
-
D
combine two DataFrames on a common key
Correct answer
-
A
the data types of columns
-
B
the number of missing values
-
C
a tuple of rows and columns
Correct answer
-
D
the column names