Pandas MCQ Test: Pandas MCQs - Practice Questions
1. What does the Pandas function 'df.isnull()' return?
2. In Pandas, what does the `isin()` method do?
3. How can you perform element-wise addition of two Pandas Series 's1' and 's2'?
4. What does the Pandas function 'df.drop()' do?
5. In Pandas, what is the purpose of the `nsmallest()` function?
6. What does the `diff()` function in Pandas allow you to calculate?
7. How can you efficiently calculate the percentage change in a Pandas DataFrame for multiple columns?
8. How do you check the data types of columns in a Pandas DataFrame?
9. What is the purpose of the `apply()` function in Pandas?
10. In Pandas, how can you efficiently handle outliers by transforming them based on a power transformation?
11. Which Pandas method is used to pivot a DataFrame based on column values?
12. How can you convert a Pandas DataFrame to a NumPy array?
13. In Pandas, what method is used to drop missing values from a DataFrame?
14. What does the `melt()` function in Pandas allow you to do?
15. How can you handle outliers in a Pandas DataFrame?
16. How do you perform multi-index sorting in a Pandas DataFrame?
17. Which Pandas method is used to calculate the correlation between columns in a DataFrame?
18. What is the purpose of the `resample()` method in Pandas?
19. In Pandas, how can you select multiple columns from a DataFrame?
20. What is the purpose of the `pivot_table()` function in Pandas?
21. How do you efficiently apply a function to elements in a specific column of a Pandas DataFrame?
22. What does the `pd.cut()` function in Pandas allow you to do?
23. How can you select multiple columns 'col1' and 'col2' from a Pandas DataFrame 'df'?
24. In Pandas, how can you sort a DataFrame based on multiple columns?
25. What does the Pandas function 'df.groupby()' allow you to do?
26. How can you calculate the median of a specific column 'column_name' in a Pandas DataFrame 'df'?
27. How can you rename a column 'old_name' to 'new_name' in a Pandas DataFrame 'df'?
28. Which method is used to fill missing values in a Pandas DataFrame?
29. What does the Pandas function 'df.describe()' provide?
30. How do you rename a column in a Pandas DataFrame?
31. What does the Pandas function 'df.info()' provide?
32. In Pandas, what does the `str.replace()` method do?
33. How can you handle duplicate rows in a Pandas DataFrame?
34. In Pandas, what is the purpose of the `nunique()` function?
35. How can you select a specific column 'column_name' from a Pandas DataFrame 'df'?
36. Which Pandas function is used to calculate summary statistics of a DataFrame?
37. What does the `filter()` function in Pandas allow you to do?
38. Which Pandas function is used to merge two DataFrames based on a common column?
39. How can you add a new column 'new_column' with values 1, 2, 3, ... N to a Pandas DataFrame 'df'?
40. How can you find the number of unique values in a column 'column_name' in a Pandas DataFrame 'df'?
41. How can you sort a Pandas DataFrame 'df' by the values in the column 'column_name' in ascending order?
42. What does the Pandas function 'df.fillna()' do?
43. What does the `loc` function in Pandas allow you to do?
44. How can you check the first few rows of a Pandas DataFrame 'df'?
45. What is the purpose of the Pandas function 'df.iloc[]'?
46. In Pandas, how can you efficiently encode categorical variables using one-hot encoding with a specified prefix for column names?
47. In Pandas, what does the `explode()` function do?
48. Which Pandas function is used to perform element-wise mathematical operations on two DataFrames?
49. How can you filter rows in a Pandas DataFrame 'df' where the column 'column_name' is equal to 10?
50. In Pandas, how do you create a new column based on the maximum value from multiple columns?