- Home
- MCQs by exam
- NTS
- Data Science
NTS MCQs – Data Science · Page 7
266 multiple choice questions typical of the NTS exam, with answers and explanations. Switch on practice mode to test yourself first.
-
A
concat removes duplicate rows while merging keeps them
-
B
merge joins on shared keys; concat stacks along an axis
Correct answer
-
C
merge stacks along an axis; concat joins on shared keys
-
D
merge only works on datetime indexes
-
A
Sales summed across all columns grouped by city
-
B
Total sales per distinct city value
Correct answer
-
C
Overall sales total ignoring the city column
-
D
The row count in each city group
-
A
Both address the row whose label equals 2
-
B
loc works only on columns, iloc only on rows
-
C
loc uses the index label 2; iloc uses position 2
Correct answer
-
D
loc uses position 2; iloc uses the index label 2
-
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
False, but the row is returned
-
B
An error during execution
-
C
Unknown, so no row is returned
Correct answer
-
D
True, whenever x is NULL
-
A
It refers to a column of the outer row
Correct answer
-
B
It returns exactly one column
-
C
It appears only in the FROM clause
-
D
It joins two copies of one table
-
A
Primary key order
-
B
Ascending
Correct answer
-
C
Descending
-
D
Insertion order
-
A
The sum of all its arguments
-
B
NULL if any argument is NULL
-
C
The first argument that is not NULL
Correct answer
-
D
The last argument that is not NULL
-
A
Combines columns, not rows
-
B
Removes duplicate rows
Correct answer
-
C
Keeps duplicate rows
-
D
Sorts by the first column
-
A
Physical sorting of the table rows
-
B
A default value for new rows
-
C
Uniqueness with no NULL values
Correct answer
-
D
Uniqueness while allowing NULLs
-
A
RANK gives tied rows different ranks
-
B
DENSE_RANK leaves gaps after ties
-
C
DENSE_RANK ignores the ORDER BY
-
D
RANK leaves gaps after ties
Correct answer
-
A
GROUP BY
Correct answer
-
B
ORDER BY
-
C
WHERE
-
D
LIMIT
-
A
It ignores them entirely
Correct answer
-
B
It treats them as zeros
-
C
It returns NULL for the column
-
D
It raises an error on NULL
-
A
Keeps only rows with NULLs
-
B
Removes duplicate result rows
Correct answer
-
C
Sorts the result rows
-
D
Counts repeated rows
-
A
The right row with NULLs on the left
-
B
Nothing; the row is dropped
-
C
The left row with NULLs on the right
Correct answer
-
D
Only rows that found a match
-
A
Rows where the column is NULL
Correct answer
-
B
Rows that duplicate earlier ones
-
C
Rows rejected by the WHERE clause
-
D
Rows whose value is zero
-
A
WHERE may test aggregate values
-
B
WHERE is applied after ORDER BY
-
C
WHERE filters rows before grouping
Correct answer
-
D
WHERE filters groups after grouping
-
A
Number of trees using a feature
-
B
Statistical p-value of each feature
-
C
Original scale of each feature
-
D
Relative contribution of each feature
Correct answer
-
A
Minus one to zero
-
B
Zero to one
Correct answer
-
C
Minus one to one
-
D
Zero to a hundred