Datacamp - Data Manipulation with Pandas.
Exam Questions And Answers 100% Verified
And Updated.
What are DataFrames? - Answer✔DataFrame are pandas representation of rectangular data, or
tabular data.
What are useful methods to explore DataFrames? - Answer✔.head(): to see the first few rows;
.info(): to see the names, datatypes and if there are missing values of each column;
.shape: informs the number of rows (x) and columns (y); Obs: .shape is an attribute, not a
method.
.describe(): computes some summary statistics for numerical columns, like mean and median.
What are the DataFrame components? - Answer✔There are three components, which are:
1. Values;
2. Columns labels;
3. Index (row labels).
What is Sorting and Subsetting? - Answer✔It is the simplest way to sort and find relevant data
while using pandas DataFrame.
How to sort DataFrames? - Answer✔Using the .sort_values method.
How to sort DataFrames? - Answer✔We can use both the Square Brackets and loc/iloc methods.
When using one square bracket, the result is a Pandas series.
When using two square brackets, the result is a DataFrame.
What is the difference between sorting and subsetting? - Answer✔While sorting organizes the
values by ascending e descending, subsetting just retrieve (or query) the data passed in the
arguments. In other words, it filters the DataFrame.
How and when to use the .isin() method? - Answer✔The best time to use .isin() is when there is
a need to subset multiple values of a categorical variable.
1|Page