Pandas Library Fundamentals
- 36Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
36 questions
- 1To install pandas in a standard Python environment, you type `_____install pandas`.
Hint
This is the standard package manager for Python packages.
Answer
pip
- 2On Mac or Linux, the command to install pandas is `_____install pandas`.
Hint
The Python 3 version of pip on Unix-like systems.
Answer
pip3
- 3In a UV virtual environment, after running_____
uv init ., you install pandas with `pandas`.Hint
The UV command to add a package to the project.
Answer
uv add
- 4The standard import statement for pandas is `import pandas as_____`.
Hint
This abbreviation is commonly used in the pandas community.
Answer
pd
- 5Pandas has two core data structures: the 2D_____and the 1D Series.
Hint
Think of a spreadsheet or SQL table.
Answer
DataFrame
- 6A pandas_____is a one-dimensional labeled array, similar to a column.
Hint
It represents a single column or row of data.
Answer
Series
- 7To load a CSV file into a DataFrame, you use the function `pd._____('file.csv')`.
Hint
This method is specifically for comma-separated values files.
Answer
read_csv
- 8To load an Excel spreadsheet into a DataFrame, you use the function `pd._____('file.xlsx')`.
Hint
This method is for Excel files.
Answer
read_excel
- 9A DataFrame can be created manually from a Python_____containing key-value pairs that become columns.
Hint
This data structure maps keys to values.
Answer
dictionary
- 10The method `df._____` returns the first five rows of a DataFrame.
Hint
Opposite of tail; shows the beginning.
Answer
head()
- 11The method `df._____` returns the last five rows of a DataFrame.
Hint
Opposite of head; shows the end.
Answer
tail()
- 12The method `df._____` provides general information about the DataFrame, including column types and non-null counts.
Hint
It gives a concise summary of the DataFrame.
Answer
info()
- 13The method `df._____` generates descriptive statistics for numeric columns.
Hint
It summarizes central tendency and dispersion.
Answer
describe()
- 14The attribute `df._____` returns a list of all column labels.
Hint
It's an attribute, not a method.
Answer
columns
- 15The attribute `df._____` returns the row index, often a RangeIndex.
Hint
It's the row labels.
Answer
index
- 16When you select a single column from a DataFrame, the result is a_____.
Hint
It's a one-dimensional labeled array.
Answer
Series
- 17When you select multiple columns from a DataFrame using a list, the result is a_____.
Hint
The result is two-dimensional.
Answer
DataFrame
- 18To access rows by integer position, use the method `df._____`.
Hint
Stands for integer location.
Answer
iloc
- 19In the example, to get the country value from the 10th row, you use `df.iloc[10]['_____']`.
Hint
This column contains country names.
Answer
country
- 20To filter rows where the 'category' column equals 'Electronics', you write `df[df['_____'] == 'Electronics']`.
Hint
This column contains product categories.
Answer
category
- 21To combine two filter conditions with AND, you use the_____operator.
Hint
It's the bitwise AND operator.
Answer
&
- 22To combine two filter conditions with OR, you use the_____operator.
Hint
It's the bitwise OR operator.
Answer
|
- 23To filter rows where a string column starts with a certain letter, you use `df['name'].str._____('A')`.
Hint
A string method that checks the beginning of strings.
Answer
startswith
- 24To filter rows where a string column ends with a certain letter, you use `df['name'].str._____('a')`.
Hint
A string method that checks the end of strings.
Answer
endswith
- 25To filter rows where a column's value is in a list of values, you use the method `df['col']._____([list])`.
Hint
It stands for 'is in'.
Answer
isin
- 26The_____operator is used to negate a boolean condition in pandas.
Hint
It's a unary operator that flips boolean values.
Answer
~ (tilde)
- 27To update all rows matching a condition, you use `df.loc[df['country'] == 'USA', '_____'] = 'United States'`.
Hint
The column you want to update.
Answer
country
- 28To convert all entries in a column to uppercase, you can use `df['_____'] = df['country'].str.upper()`.
Hint
The column being updated.
Answer
country
- 29To remove all rows containing any null values, use the method `df._____()`.
Hint
It stands for 'drop N/A'.
Answer
dropna
- 30To replace null values with a specific value, use the method `df._____(value)`.
Hint
It stands for 'fill N/A'.
Answer
fillna
- 31To modify the DataFrame directly without assigning the result, set the parameter `_____=True`.
Hint
It means the operation is done on the object itself.
Answer
inplace
- 32To rename a column, you pass a dictionary to the_____
columnsparameter of `df.`.Hint
It changes column labels.
Answer
rename
- 33To get a count of each unique value in a column, use the method `df['col']._____()`.
Hint
It returns a Series with frequencies.
Answer
value_counts
- 34To calculate the sum of a numeric column for each group, use `df.groupby('country')['_____'].sum()`.
Hint
The column to aggregate.
Answer
price
- 35To sort the DataFrame by a column, use the method `df._____('column', ascending=False)`.
Hint
It orders rows by the specified column.
Answer
sort_values
- 36To save a DataFrame to a CSV file, use the method `df._____('filename.csv', index=False)`.
Hint
It writes the DataFrame to a comma-separated file.
Answer
to_csv

Ask anything
We've read this whole study set, so questions about it get the best answers.