Get Membership To Play All Videos In This Website.
Sign-in
Sign-up
Regular
Python
Membership
DataEngineering
Basics
Video Courses
Telugu Language
English Language
Online Test
Python Blog
Interview Questions
Online Test
1). Which method is used to merge two DataFrames based on a key column??
A) merge()
B) join()
C) concat()
D) append()
2). How can you change the index of a DataFrame to a column named 'ID'??
A) df.set_index('ID')
B) df.change_index('ID')
C) df.index('ID')
D) df.index_col('ID')
3). Which function is used to read Excel files into a Pandas DataFrame??
A) pd.read_excel()
B) pd.load_excel()
C) pd.import_excel()
D) pd.read_csv()
4). How do you filter rows in a DataFrame where the 'Salary' column is greater than 50000??
A) df[df['Salary'] > 50000]
B) df.filter('Salary' > 50000)
C) df.select('Salary' > 50000)
D) df.loc['Salary' > 50000]
5). What method is used to remove duplicates from a DataFrame??
A) drop_duplicates()
B) remove_duplicates()
C) delete_duplicates()
D) drop_na()
6). How can you rename columns of a DataFrame??
A) df.rename(columns={'old_name': 'new_name'})
B) df.change_columns({'old_name': 'new_name'})
C) df.columns_rename({'old_name': 'new_name'})
D) df.update_columns({'old_name': 'new_name'})
7). Which method is used to join two DataFrames on their indices??
A) join()
B) merge()
C) concat()
D) combine()
8). How can you create a pivot table using Pandas??
A) df.pivot_table(values='value_column', index='index_column', columns='columns_column')
B) df.create_pivot()
C) df.pivot()
D) df.pivot_data()
9). How can you check for missing values in a DataFrame??
A) df.isna()
B) df.check_na()
C) df.find_na()
D) df.missing()
10). Which method is used to concatenate two DataFrames along rows??
A) concat()
B) merge()
C) join()
D) append()
11). How do you calculate the mean of a column named 'age' in a DataFrame??
A) df['age'].mean()
B) df['age'].avg()
C) df.mean('age')
D) df['age'].average()
12). What method would you use to reset the index of a DataFrame??
A) reset_index()
B) set_index()
C) index_reset()
D) index_set()
13). Which method would you use to sort a DataFrame by a column named 'score'??
A) sort_values()
B) sort_by()
C) order_by()
D) arrange()
14). How can you drop a column named 'unnecessary_column' from a DataFrame??
A) df.drop('unnecessary_column', axis=1)
B) df.remove('unnecessary_column')
C) df.delete('unnecessary_column')
D) df.discard('unnecessary_column')
15). How would you apply a function to each element of a DataFrame column??
A) df['column'].apply(func)
B) df['column'].map(func)
C) df['column'].transform(func)
D) df['column'].apply_func(func)
16). Which method is used to calculate the cumulative sum of a column named 'values'??
A) cumsum()
B) cum_sum()
C) sum_cumulative()
D) total_sum()
17). How can you fill missing values in a DataFrame with the mean of the column??
A) df.fillna(df.mean())
B) df.fillna(df.mean(axis=1))
C) df.replace_na(df.mean())
D) df.fill_missing(df.mean())
18). What function is used to get a quick overview of the DataFrame's statistics??
A) describe()
B) summary()
C) info()
D) overview()
19). Which method is used to concatenate two DataFrames along columns??
A) concat(axis=1)
B) merge(axis=1)
C) join(axis=1)
D) append(axis=1)
Submit
Test Results