Search test library by skills or roles
⌘ K

Adaface Sample Pandas Questions

Here are some sample Pandas questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

Data Aggregation and Transformation
Data Aggregation
Data Transformation
Solve
You are working with a dataset, `df`, that contains columns 'A', 'B', and 'C'. You need to perform the following tasks:
            
            1. Group the DataFrame `df` by column 'A'.
            2. Compute the sum of column 'B' for each group.
            3. Append this sum as a new column 'D' to the original DataFrame `df`.
            
            You wrote the following code to perform these tasks:
 image
However, you notice that the new column 'D' contains many missing values. What is the cause of this issue?
A: The groupby method did not work as expected.
            B: The sum method did not work as expected.
            C: The new column 'D' should be appended to grouped instead of df.
            D: The grouped object should be mapped to df['A'] before assigning to a new column in df
            E: The groupby method should be called on df['A'] instead of df.

Easy

Handling Missing Data
Data Cleaning
Missing Data
Solve
You are working with a dataset, `df`, that contains several columns with missing values. You want to replace all missing values in the dataset with the mean of the non-missing values of their respective columns.
            
            You wrote the following code to perform this task:
 image
However, you notice that some missing values are still not replaced. What is the cause of this issue?
A: The fillna method does not work with the mean method.
            B: The mean method does not work with missing values.
            C: The fillna method should be called on df.mean() instead of df.
            D: The fillna method does not work inplace by default. You should use df.fillna(df.mean(), inplace=True).
            E: The mean method should be called on df.fillna() instead of df.
🧐 Question🔧 Skill

Medium

Data Aggregation and Transformation
Data Aggregation
Data Transformation

2 mins

Pandas
Solve

Easy

Handling Missing Data
Data Cleaning
Missing Data

2 mins

Pandas
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Data Aggregation and Transformation
Data Aggregation
Data Transformation
Pandas
Medium2 mins
Solve
Handling Missing Data
Data Cleaning
Missing Data
Pandas
Easy2 mins
Solve

Trusted by recruitment teams in enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
customers across world
Join 1500+ companies in 80+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
ada
Ada
● Online
Previous
Score: NA
Next
✖️