Exploratory Data Analysis
- 73Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
73 questions
- 1In Spyder, the Python library used to change the working directory is_____.
Hint
Think of the library whose directory-changing command is used to set where files are accessed.
Answer
os
Explanation
The os library is used to change the working directory before accessing data files.
- 2The library used to work with data frames in the lecture is_____.
Hint
It is commonly imported with the short alias pd.
Answer
pandas
Explanation
Pandas provides tools for reading and working with data frames.
- 3The alias used for the pandas library in the examples is_____.
Hint
It is the short name placed before pandas functions such as crosstab.
Answer
pd
Explanation
The lecture imports pandas as pd and then calls its functions using that alias.
- 4The os command used to change the current working directory is_____.
Hint
Its name refers to changing a directory.
Answer
os.chdir
Explanation
The command os.chdir changes the working directory to the supplied path.
- 5The pandas function used to read a comma-separated-values file is_____.
Hint
Its name combines the action of reading with the file format.
Answer
read_csv
Explanation
The lecture uses pandas read_csv to load CSV data into Spyder.
- 6In the Toyota data import, setting the index column to zero makes the_____column the index.
Hint
Zero-based indexing refers to the item at the beginning of a sequence.
Answer
first
Explanation
The example sets the index column to 0, so the first column is used as the data frame index.
- 7The special question-mark strings in the Toyota file are treated as_____values during import.
Hint
They are converted to Python's standard representation for unavailable data.
Answer
NaN
Explanation
The question marks do not convey meaningful data in this example, so they are read as NaN values.
- 8A copy of the original data frame is made with the_____function.
Hint
It creates a separate version of the data frame for further operations.
Answer
copy
Explanation
Using the copy function allows changes to be made to the copied data frame without modifying the original.
- 9The new data frame created from the original Toyota data is named_____in the example.
Hint
It is the object name that ends in the numeral two.
Answer
cars_data_2
Explanation
The lecture saves the copied data frame in an object called cars_data_2.
- 10The main reason for making a separate copy before modifying data is to preserve the_____data set for comparison.
Hint
It is the unmodified source version of the data.
Answer
original
Explanation
Keeping the original data unchanged makes it possible to cross-check it during analysis.
- 11A frequency table for one categorical variable shows the count for each of its_____.
Hint
These are the distinct groups or values represented by the variable.
Answer
categories
Explanation
A frequency table summarizes how often each category occurs in a categorical variable.
- 12The pandas function used in the lecture to create frequency tables is_____.
Hint
It can tabulate one or more variables.
Answer
crosstab
Explanation
The pandas crosstab function computes cross-tabulations and, by default, produces frequency counts.
- 13To obtain a frequency distribution for one variable with crosstab, that variable is passed as the_____.
Hint
This is the argument that identifies the row variable in the example.
Answer
index
Explanation
The lecture supplies Fuel Type under the index argument to count its categories.
- 14Setting the missing-value exclusion option to true removes records with_____values from the frequency-table calculation.
Hint
These values are unavailable or represented as NaN.
Answer
missing
Explanation
With missing values dropped, the frequency table is calculated only from records that remain.
- 15The Toyota data initially contained_____rows before missing Fuel Type records were excluded.
Hint
This is the original data size reported in the example.
Answer
1436
Explanation
The original data frame had 1436 rows before dropping records with missing Fuel Type.
- 16After rows with missing Fuel Type values were excluded, the example retained_____records.
Hint
Subtract the 100 records with missing Fuel Type from the original row count.
Answer
1336
Explanation
The resulting data included 1336 records after missing Fuel Type rows were dropped.
- 17The difference between the original 1436 rows and the 1336 retained rows is_____records with missing Fuel Type.
Hint
Compare the before-and-after row counts.
Answer
100
Explanation
Dropping missing Fuel Type values removed 100 records from the data.
- 18The Fuel Type categories listed in the Toyota frequency table are CNG, petrol, and_____.
Hint
It is the remaining fuel category besides CNG and petrol.
Answer
diesel
Explanation
The three reported Fuel Type categories are CNG, petrol, and diesel.
- 19In the example, the frequency of cars with CNG Fuel Type is_____.
Hint
It is the smallest of the three category counts reported.
Answer
15
Explanation
The frequency table shows 15 cars with CNG as their Fuel Type.
- 20In the example, the frequency of cars with diesel Fuel Type is_____.
Hint
This count is greater than the CNG count but less than the petrol count.
Answer
144
Explanation
The table reports 144 cars with diesel Fuel Type.
- 21The number of cars with petrol Fuel Type is_____in the example, making it the most common category.
Hint
It is the largest of the three category frequencies.
Answer
1177
Explanation
The frequency table shows 1177 petrol cars, so petrol is the most common Fuel Type in this data.
- 22A two-way table is used to examine the relationship between_____categorical variables.
Hint
It cross-tabulates one variable against another.
Answer
two
Explanation
The lecture uses a two-way table to compare the frequencies of two categorical variables.
- 23In the example two-way table, the gearbox variable is named_____.
Hint
It records whether the car has a manual or automatic gearbox using coded values.
Answer
Automatic
Explanation
The variable called Automatic represents the gearbox type in the Toyota data.
- 24In the Automatic variable, the value 0 represents a_____gearbox.
Hint
It is the non-automatic gearbox category.
Answer
Manual
Explanation
The example defines 0 as a car with a Manual gearbox.
- 25In the Automatic variable, the value 1 represents an_____gearbox.
Hint
The coded value matches the variable's name.
Answer
Automatic
Explanation
The example defines 1 as a car with an Automatic gearbox.
- 26To tabulate gearbox counts by fuel type, the example places Automatic in the index and Fuel Type in the_____.
Hint
This argument determines which variable appears across the top of the table.
Answer
columns
Explanation
The two-way table uses Automatic for its rows and Fuel Type for its columns.
- 27When missing values are dropped in the two-way table, a row is included only if both Automatic and Fuel Type are_____.
Hint
Neither variable may be unavailable for that record.
Answer
observed
Explanation
The table counts rows only when both variables have values; rows missing either one are skipped.
- 28In the two-way table, the 15 cars with CNG Fuel Type and a Manual gearbox appear at the intersection of the CNG column and the_____row.
Hint
The row corresponds to the gearbox category represented by zero.
Answer
Manual
Explanation
The count of 15 describes cars that have both CNG Fuel Type and a Manual gearbox.
- 29The example's two-way table shows that cars with Automatic gearboxes have only_____Fuel Type.
Hint
The table has zero Automatic cars for the other two listed fuel categories.
Answer
petrol
Explanation
The table reports no Automatic cars with CNG or diesel Fuel Type; the Automatic cars shown have petrol Fuel Type.
- 30The two-way table reports_____cars with a Manual gearbox and diesel Fuel Type.
Hint
This is the diesel count in the Manual gearbox row.
Answer
144
Explanation
The example identifies 144 cars as having both a Manual gearbox and diesel Fuel Type.
- 31Joint probability describes the probability that two events occur at the_____time.
Hint
The events are considered together rather than separately.
Answer
same
Explanation
A joint probability gives the likelihood of two events happening together.
- 32In a crosstab, setting normalize to true converts frequency counts into_____.
Hint
These are relative values that can be interpreted as probabilities.
Answer
proportions
Explanation
Normalization changes the table values from raw counts to proportions.
- 33In the example, the joint probability of a Manual gearbox and CNG Fuel Type is approximately_____.
Hint
This is the small proportion reported for that combination.
Answer
0.01
Explanation
The normalized table gives a joint probability of about 0.01 for Manual gearbox and CNG Fuel Type.
- 34In the example, the joint probability of a Manual gearbox and petrol Fuel Type is approximately_____.
Hint
This is the comparatively large proportion reported for the combination.
Answer
0.82
Explanation
The joint probability for a Manual gearbox together with petrol Fuel Type is about 0.82 in the example.
- 35Marginal probability concerns the occurrence of a_____event considered alone.
Hint
It does not describe the combined occurrence of two events.
Answer
single
Explanation
A marginal probability gives the probability of one event without conditioning on another event.
- 36In crosstab, the option used to add row and column totals for marginal probabilities is_____.
Hint
Turning this option on adds an All total row and column.
Answer
margins
Explanation
Setting margins to true adds row and column sums, which can be used to read marginal probabilities.
- 37When a normalized table includes margins, the row and column totals are displayed under the label_____.
Hint
This label identifies the totals added by the margins option.
Answer
All
Explanation
The table displays the added row and column totals in an All row and column.
- 38The total probability across all cells of a complete probability table sums to_____.
Hint
This represents the certainty that one of the outcomes in the table occurs.
Answer
1
Explanation
The probabilities across all outcomes in the table sum to 1.
- 39The marginal probability of a Manual gearbox reported in the example is approximately_____.
Hint
It is the first marginal value discussed in the lecture.
Answer
0.946895
Explanation
The lecture interprets 0.946895 as the probability of a Manual gearbox across the fuel categories.
- 40The marginal probability of petrol Fuel Type reported in the example is approximately_____.
Hint
It is the probability of petrol regardless of gearbox type.
Answer
0.88
Explanation
The petrol marginal probability combines cars with Automatic and Manual gearboxes and is about 0.88.
- 41Conditional probability is the probability of event A given that event B has already_____.
Hint
The second event is treated as having happened already.
Answer
occurred
Explanation
Conditional probability describes the chance of one event under the condition that another event has occurred.
- 42Normalizing a crosstab by index makes each_____sum to 1.
Hint
In the example, this conditions on the gearbox type represented by each row.
Answer
row
Explanation
Index normalization produces conditional probabilities across each row, so each row totals 1.
- 43With index normalization, the table answers questions about fuel type given the type of_____.
Hint
This is the variable placed in the rows of the example table.
Answer
gearbox
Explanation
Each row represents a gearbox type, so the normalized entries give fuel-type probabilities conditional on gearbox type.
- 44Given a Manual gearbox, the example's probability of CNG Fuel Type is approximately_____.
Hint
Use the row-normalized table and look at the CNG entry in the Manual row.
Answer
0.01
Explanation
The conditional probability of CNG given a Manual gearbox is reported as 0.01.
- 45Given a Manual gearbox, the example's probability of petrol Fuel Type is approximately_____.
Hint
It is the largest fuel-type probability in the Manual row.
Answer
0.87
Explanation
The row-normalized table gives a petrol probability of about 0.87 for cars with a Manual gearbox.
- 46Normalizing by columns makes each_____sum to 1.
Hint
This reverses the conditioning direction compared with index normalization.
Answer
column
Explanation
Column normalization creates conditional probabilities within each column, making every column total 1.
- 47With column normalization, the table answers questions about gearbox type given the car's_____.
Hint
This is the variable represented by the columns in the example.
Answer
Fuel Type
Explanation
Each column fixes a Fuel Type, so the normalized entries give probabilities for gearbox types conditional on that Fuel Type.
- 48In the example, given CNG Fuel Type, the probability of a Manual gearbox is_____.
Hint
There are no Automatic cars in the CNG column of the table.
Answer
1
Explanation
All observed CNG cars in this example have Manual gearboxes, giving a conditional probability of 1.
- 49Given petrol Fuel Type, the example's probability of a Manual gearbox is approximately_____.
Hint
Read the Manual entry in the petrol column-normalized values.
Answer
0.93
Explanation
The column-normalized table reports a probability of about 0.93 for a Manual gearbox given petrol Fuel Type.
- 50Correlation measures the strength of association between two_____variables in the lecture's examples.
Hint
The measure is contrasted with cross-tabulation of categorical variables.
Answer
numerical
Explanation
The lecture uses correlation to study the association between numerical variables.
- 51A scatter plot with points tending to rise as one variable increases indicates a_____trend.
Hint
Both variables tend to increase together.
Answer
positive
Explanation
A positive trend means that larger values of one variable tend to accompany larger values of the other.
- 52If a car's weight increases and its price tends to increase as well, the relationship has a_____trend.
Hint
The two quantities move in the same direction.
Answer
positive
Explanation
When both variables tend to increase together, their relationship is positive.
- 53A scatter plot with points spread without a discernible pattern suggests_____correlation.
Hint
The plot does not show a consistent relationship between the variables.
Answer
no
Explanation
When the points are scattered without a pattern, the lecture describes the variables as having no correlation.
- 54Correlation values are bounded between_____and plus 1.
Hint
The lower endpoint represents the strongest negative direction on the scale.
Answer
minus 1
Explanation
The correlation coefficient ranges from minus 1 to plus 1.
- 55A correlation of 0 represents_____correlation between two numerical variables.
Hint
It indicates an absence of linear association as described in the lecture.
Answer
no
Explanation
The lecture states that a value of 0 represents no correlation between the variables.
- 56A correlation value closer to positive 1 indicates a stronger_____association.
Hint
The sign identifies the direction of the relationship.
Answer
positive
Explanation
Values closer to positive 1 indicate stronger positive correlation.
- 57A correlation value closer to minus 1 indicates a stronger_____association.
Hint
The sign indicates that the variables tend to move in opposite directions.
Answer
negative
Explanation
Values closer to minus 1 indicate stronger negative correlation.
- 58The lecture describes a correlation above 0.7 as a_____correlation between numerical variables.
Hint
This is the strength description used for values beyond the stated threshold.
Answer
fair
Explanation
The lecture says that, theoretically, a value above 0.7 indicates a fair correlation.
- 59If car age increases while price tends to decrease, the relationship is a_____correlation.
Hint
The variables move in opposite directions.
Answer
negative
Explanation
Older cars tending to have lower prices is an example of a negative relationship.
- 60The pandas data-frame method used to calculate correlations is_____.
Hint
It is called on a data frame to calculate correlations among its columns.
Answer
corr
Explanation
The lecture uses the corr method to calculate correlation values for data-frame columns.
- 61The corr method calculates_____correlations among columns when applied to a data frame.
Hint
It evaluates relationships between pairs of columns.
Answer
pairwise
Explanation
The method computes pairwise correlations among the selected data-frame columns.
- 62By default, the correlation calculation excludes_____values.
Hint
These unavailable observations should not be used in the calculation.
Answer
missing
Explanation
The correlation method excludes missing values when calculating correlations.
- 63The default correlation method discussed in the lecture is_____correlation.
Hint
It is the standard measure described for numerical variables.
Answer
Pearson
Explanation
The lecture states that the default method is Pearson correlation.
- 64Pearson correlation is used to measure the strength of association between two_____variables.
Hint
It is the measure selected after categorical variables are excluded.
Answer
numerical
Explanation
Pearson correlation is used here to assess the association between numerical variables.
- 65For ordinal variables, the lecture names Kendall rank correlation and_____rank correlation as alternatives.
Hint
It is the other rank-based measure mentioned alongside Kendall.
Answer
Spearman
Explanation
The lecture suggests Kendall rank correlation or Spearman rank correlation for ordinal variables.
- 66To calculate Pearson correlations for numerical columns only, the example excludes columns of data type_____.
Hint
This data type is used for categorical columns in the example.
Answer
object
Explanation
Excluding object columns removes categorical variables before calculating Pearson correlations.
- 67After excluding categorical columns, the example's numerical data frame contains_____variables.
Hint
The original data had ten variables, and two were excluded.
Answer
eight
Explanation
The numerical data frame has eight variables after categorical columns are removed.
- 68The numerical data frame in the example contains_____observations.
Hint
This is the row count reported for the selected numerical data.
Answer
1436
Explanation
The selected numerical data frame is reported as having 1436 observations.
- 69The correlation between a variable and itself appears as_____on the principal diagonal of the correlation matrix.
Hint
A variable is perfectly correlated with itself.
Answer
one
Explanation
Each diagonal entry compares a variable with itself, so its correlation is 1.
- 70The example reports a correlation of about minus 0.87 between car price and car_____.
Hint
As this quantity increases, the example says price tends to decrease.
Answer
age
Explanation
The price-age correlation is approximately minus 0.87, indicating a strong negative association in the data.
- 71The correlation between car price and kilometre is about minus_____.
Hint
Its magnitude is slightly above 0.5, and its direction is negative.
Answer
0.57
Explanation
The example gives a price-kilometre correlation of approximately minus 0.57, consistent with higher mileage tending to accompany lower prices.
- 72The example reports a positive correlation of about_____between car weight and price.
Hint
Heavier cars tend to have higher prices in the example.
Answer
0.58
Explanation
A correlation of about 0.58 indicates that weight and price tend to increase together in the data.
- 73The example describes the relationship between car kilometre and age as positive, with a correlation around_____.
Hint
Older cars tend to have accumulated more kilometres.
Answer
0.5
Explanation
The lecture reports an approximate positive correlation of 0.5 between kilometre and age.

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