Quiz on pandas
Check how much you remember from previous sections by answering the questions below.
What is data wrangling?
✓A method of cleaning and transforming raw data.
✗An algorithm used to visualize data.
✗A data storage technique.
✗A type of statistical modeling.
What does “munging” refer to in data science?
✗A process of building machine learning models.
✗A technique for visualizing data.
✓Cleaning and preparing data for analysis
✗A method of organizing files in a database.
Which of the following is NOT an ideal strategy to handle missing data in a dataset?
✗Removing rows with missing data.
✗Filling missing data with a constant value.
✗Ignoring the missing data.
✓Adding random data to fill the gaps.
Which of the following methods in pandas is used to check for missing values in a dataset?
✓df.isnull()
✗df.fillna()
✗df.dropna()
✗df.notnull()
You want to load a CSV file into a pandas DataFrame. Which function would you use?
✓pd.read_csv('file.csv')
✗pd.load_csv('file.csv')
✗pd.open_csv('file.csv')
✗pd.read_file('file.csv')
What does df['column'].astype(float)
do in a pandas DataFrame?
✗Changes the entire DataFrame to float type.
✓Changes the datatype of a specific column to float.
✗Deletes the column named 'column'
.
✗Changes the column index to float numbers.
What does the float
datatype represents?
✗A sequence of Unicode characters.
✓A number with decimal places.
✗A number without decimal places.
✗Any arbitrary object.
Which of these conditions does NOT describe a tidy data frame?
✗Each observation forms a row.
✓Each column contains only non-missing values.
✗Each variable forms a column.
✗Each type of observational unit forms a table.
Which package is used by pandas for plotting?
✗seaborn
✗pyplot
✓matplotlib
✗hvplot
What does df.loc[:, "cat":"dog"]
do?
✗Selects all rows and columns "cat"
and "dog"
.
✗Selects all columns and rows "cat"
and "dog"
.
✗Selects all columns and all rows between rows "cat"
and "dog"
.
✓Selects all rows and all columns bewtween columns "cat"
and "dog"
.