NEW
Font size
WorksheetsPandas DataFrame Quiz
Total questions: 20
Worksheet time: 10mins
What is a DataFrame in Pandas?
A one-dimensional array
A way to store data in rectangular grids
A graphical representation of data
A type of database
Which of the following is NOT a component of a Pandas DataFrame?
Data
Columns
Index
Rows
What method is used to read a CSV file into a DataFrame?
pd.read_csv()
pd.load_csv()
pd.import_csv()
pd.open_csv()
Which function is used to display the first n rows of a DataFrame?
df.top(n)
df.start(n)
df.head(n)
df.first(n)
How can you filter rows in a DataFrame based on a condition?
Using SQL queries
Using string matching
Using Boolean indexing
Using regular expressions
What does the method df.describe() provide?
Basic statistical details of numerical columns
A graphical representation of data
The data types of each column
The shape of the DataFrame
Which method is used to drop rows with missing values?
df.clear_na()
df.delete_na()
df.remove_na()
df.dropna()
What is the purpose of the df.groupby() method?
To filter out missing values
To merge two DataFrames
To sort data in ascending order
To group data according to some criteria
Which function is used to plot data from a DataFrame?
df.graph()
df.chart()
df.plot()
df.visualize()
What does the method df.fillna() do?
Displays the DataFrame shape
Counts the number of missing values
Removes rows with missing values
Fills missing values with a specified value
Which of the following is a valid way to create a DataFrame from a dictionary?
pd.DataFrame(dict)
pd.create_dataframe(dict)
pd.new_dataframe(dict)
pd.DataFrame.from_dict(dict)
What does the df.shape attribute return?
The index of the DataFrame
The data types of each column
The total number of elements
The dimensionality of the DataFrame
Which method is used to sort a DataFrame by a specific column?
df.order_by()
df.sort()
df.arrange()
df.sort_values()
What is the purpose of the df.rank() method?
To assign ranks based on position after sorting
To group data by a specific column
To calculate the mean of a column
To filter out duplicate values
What method is used to concatenate two DataFrames?
pd.concat()
pd.merge()
pd.join()
pd.append()
Which function is used to convert a DataFrame to a NumPy array?
df.to_numpy()
df.as_array()
df.to_array()
df.convert_to_numpy()
What does the df.info() method display?
Summary of the DataFrame including data types
Statistical summary of numerical columns
First few rows of the DataFrame
Shape of the DataFrame
Which method is used to reset the index of a DataFrame?
df.reset_index()
df.reindex()
df.set_index()
df.index_reset()
How can you check for duplicate rows in a DataFrame?
df.duplicates()
df.check_duplicates()
df.duplicated()
df.find_duplicates()
What does the df.drop() method do?
Removes specified rows or columns
Displays the DataFrame without modifications
Sorts the DataFrame
Filters the DataFrame based on conditions
