Pandas MCQ Test: Pandas MCQs - Practice Questions
1. What does the Pandas function 'df.fillna()' do?
2. What does the `pd.to_datetime()` function in Pandas do?
3. In Pandas, what does the `explode()` function do?
4. How do you rename a column in a Pandas DataFrame?
5. What does the `groupby()` function in Pandas allow you to do?
6. In Pandas, how can you efficiently handle outliers by transforming them based on a power transformation?
7. What is the purpose of the Pandas function 'df.mean()'?
8. What is the purpose of the `pivot_table()` function in Pandas?
9. How can you filter rows in a Pandas DataFrame 'df' where the column 'column_name' is equal to 10?
10. What does the `filter()` function in Pandas allow you to do?
11. How do you check the data types of columns in a Pandas DataFrame?
12. What does the Pandas function 'df.info()' provide?
13. What does the `diff()` function in Pandas allow you to calculate?
14. In Pandas, what does the `interpolate()` function do?
15. What is the purpose of the Pandas function 'df.iloc[]'?
16. What is the purpose of the `apply()` function in Pandas?
17. In Pandas, how can you efficiently handle heavy-tailed distributions by applying a power transformation?
18. How can you drop rows with missing values in a Pandas DataFrame 'df'?
19. How can you handle outliers in a Pandas DataFrame?
20. In Pandas, what does the `isin()` method do?
21. Which method is used to fill missing values in a Pandas DataFrame?
22. In Pandas, what is the purpose of the `nsmallest()` function?
23. Which Pandas function is used to perform element-wise mathematical operations on two DataFrames?
24. How can you rename a column 'old_name' to 'new_name' in a Pandas DataFrame 'df'?
25. What is the purpose of the `ffill()` and `bfill()` functions in Pandas?
26. Which Pandas function is used to merge two DataFrames based on a common column?
27. In Pandas, how can you calculate the percentage change in a DataFrame?
28. What is the primary data structure in Pandas for handling one-dimensional labeled data?
29. In Pandas, how do you efficiently calculate a rolling window average for a specific column?
30. In Pandas, how do you create a new column based on the maximum value from multiple columns?
31. What is the purpose of the Pandas function 'df.drop_duplicates()'?
32. How can you efficiently aggregate and count the occurrence of unique combinations in two columns of a Pandas DataFrame?
33. What is the purpose of the `str.contains()` method in Pandas?
34. What does the Pandas function 'df.groupby()' allow you to do?
35. How can you find the number of unique values in a column 'column_name' in a Pandas DataFrame 'df'?
36. How can you efficiently calculate the percentage change in a Pandas DataFrame for multiple columns?
37. How do you efficiently handle time zone conversion in a Pandas DataFrame?
38. In Pandas, how can you efficiently encode categorical variables using one-hot encoding with a specified prefix for column names?
39. What does the Pandas function 'df['column_name'].unique()' return?
40. What is the purpose of the `resample()` method in Pandas?
41. How can you efficiently handle imbalanced data in a classification problem using Pandas?
42. What is the purpose of the `between_time()` method in Pandas?
43. How can you sort a Pandas DataFrame 'df' by the values in the column 'column_name' in ascending order?
44. How do you efficiently calculate the pairwise correlation matrix for selected columns in a Pandas DataFrame?
45. In Pandas, what is the purpose of the `nunique()` function?
46. How can you efficiently handle missing values in a Pandas DataFrame considering both forward and backward filling?
47. What does the `loc` function in Pandas allow you to do?
48. How can you add a new column 'new_column' with values 1, 2, 3, ... N to a Pandas DataFrame 'df'?
49. What does the Pandas function 'df.describe()' provide?
50. How can you check the first few rows of a Pandas DataFrame 'df'?