Pandas MCQ Test: Pandas MCQs - Practice Questions
1. What does the `melt()` function in Pandas allow you to do?
2. What does the `loc` function in Pandas allow you to do?
3. How can you handle outliers in a Pandas DataFrame?
4. In Pandas, what does the `str.replace()` method do?
5. What does the `pd.to_datetime()` function in Pandas do?
6. Which method is used to fill missing values in a Pandas DataFrame?
7. How can you efficiently handle missing values in a Pandas DataFrame considering both forward and backward filling?
8. What does the Pandas function 'df.isnull()' return?
9. How can you efficiently handle imbalanced data in a classification problem using Pandas?
10. How can you check the first few rows of a Pandas DataFrame 'df'?
11. What is the primary data structure in Pandas for handling one-dimensional labeled data?
12. What does the Pandas function 'df.drop()' do?
13. In Pandas, what is the purpose of the `nsmallest()` function?
14. How can you perform element-wise addition of two Pandas Series 's1' and 's2'?
15. In Pandas, how can you efficiently handle outliers by transforming them based on a power transformation?
16. What is the purpose of the `cummin()` function in Pandas?
17. What is the purpose of the `resample()` method in Pandas?
18. What does the `diff()` function in Pandas allow you to calculate?
19. In Pandas, how can you calculate the percentage change in a DataFrame?
20. How can you efficiently aggregate and count the occurrence of unique combinations in two columns of a Pandas DataFrame?
21. In Pandas, how can you efficiently handle heavy-tailed distributions by applying a power transformation?
22. What does the Pandas function 'df.info()' provide?
23. Which Pandas method is used to pivot a DataFrame based on column values?
24. What is the purpose of the `at_time()` method in Pandas?
25. In Pandas, what does the `explode()` function do?
26. What is the purpose of the `apply()` function in Pandas?
27. How can you efficiently calculate the percentage change in a Pandas DataFrame for multiple columns?
28. Which Pandas method is used to calculate the correlation between columns in a DataFrame?
29. How do you perform multi-index sorting in a Pandas DataFrame?
30. How can you drop rows with missing values in a Pandas DataFrame 'df'?
31. In Pandas, how can you sort a DataFrame based on multiple columns?
32. How can you add a new column 'new_column' with values 1, 2, 3, ... N to a Pandas DataFrame 'df'?
33. How can you select multiple columns 'col1' and 'col2' from a Pandas DataFrame 'df'?
34. Which Pandas function is used to perform element-wise mathematical operations on two DataFrames?
35. What does the Pandas function 'df.fillna()' do?
36. What is the purpose of the Pandas function 'df.iloc[]'?
37. Which Pandas function is used to merge two DataFrames based on a common column?
38. How can you rename a column 'old_name' to 'new_name' in a Pandas DataFrame 'df'?
39. In Pandas, what does the `interpolate()` function do?
40. What does the Pandas function 'df['column_name'].unique()' return?