Data Science · Scikit-learn What is the standard way to persist a fitted scikit-learn estimator to disk? A Copy the estimator class definition into a new module B Serialise it with joblib.dump and restore it with joblib.load Correct answer C Call model.save and reopen the file with Model.from_file D Print the model and rebuild it from the console output MCQSEXAM Show answer Read explanation
Data Science · Pandas Why use groupby(...).transform("mean") instead of groupby(...).agg("mean") in pandas? A agg returns a Series while transform returns a scalar B transform only works on datetime columns C transform broadcasts group results back to every original row Correct answer D transform is faster because it skips the grouping step entirely MCQSEXAM Show answer Read explanation
Data Science · Pandas What does pd.pivot_table primarily produce in pandas? A A long-format frame holding exactly one row for every original observation B A copy of the DataFrame sorted by its index C A frame containing only the numeric columns D A cross-tabulation with aggregated values at row and column intersections Correct answer MCQSEXAM Show answer Read explanation
Data Science · Pandas What does df["city"].value_counts() return in pandas? A The unique values without any counts attached B The number of NaN entries in the column only C Counts per distinct value, sorted most frequent first Correct answer D Counts per distinct value, sorted in alphabetical order MCQSEXAM Show answer Read explanation
Data Science · Pandas What causes the SettingWithCopyWarning in pandas? A Sorting a DataFrame with sort_values in place B Assigning through a chained index such as df[df.a > 0]["b"] Correct answer C Calling dropna on a DataFrame that holds NaN values D Reading a column with df["a"] and printing its dtype attribute MCQSEXAM Show answer Read explanation
Data Science · Pandas Which statement distinguishes Series.map from DataFrame.apply in pandas? A Both are identical when applied to any DataFrame or Series object B map only accepts NumPy ufuncs, never functions C map transforms each element; apply works row or column wise Correct answer D map works row wise; apply transforms each element MCQSEXAM Show answer Read explanation
Data Science · Pandas How does pandas merge differ from pandas concat? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas What does df.groupby("city")["sales"].sum() compute in pandas? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas What is the difference between df.loc[2] and df.iloc[2]? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas Which pandas expression returns the number of rows in a DataFrame df? A len(df) Correct answer B df.size C df.columns D df.ndim MCQSEXAM Show answer Read explanation
Data Science · Pandas Which statistics does df.describe() report by default for numeric columns? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas What does df.dropna() do by default in pandas? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas What does df["price"] return for a DataFrame df in pandas? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas What does df.head() return by default in pandas? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas For a DataFrame with 200 rows and 6 columns, what does df.shape return? 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 MCQSEXAM Show answer Read explanation
Data Science · Pandas Which pandas call returns a DataFrame sorted by the column 'marks' in descending order? 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) MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does the predicate x = NULL evaluate to? 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 MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What makes a subquery correlated? 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 MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What sort order does ORDER BY apply when no direction is written? A Primary key order B Ascending Correct answer C Descending D Insertion order MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does COALESCE(a, b, c) return? 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 MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does UNION do that UNION ALL does not? A Combines columns, not rows B Removes duplicate rows Correct answer C Keeps duplicate rows D Sorts by the first column MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis Which guarantee does a PRIMARY KEY constraint give? 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 MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What distinguishes RANK() from DENSE_RANK()? 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 MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis Which clause forms groups before aggregate functions are applied? A GROUP BY Correct answer B ORDER BY C WHERE D LIMIT MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis How does AVG treat NULL values in its column? 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 MCQSEXAM Show answer Read explanation