Data Analysis with Python Coursera Quiz Answers

Here you will find the Data Analysis with Python Coursera course All Quiz Answers. Data science is relatively a new field that deals with the study of data. In data science, a large amount of data is studied to extract meaningful insights for business. Data science is a multidisciplinary approach that combines principles and practices from the fields of computer science, mathematics, statistics, and artificial intelligence.

This analysis of data helps data scientists to ask and answer questions like what happened, why it happened, what will happen, and what can be done with the finding results.

Data Analysis with Python Coursera Course Quiz Answers

Week 01 Practice Quiz: Importing Datasets

Topic: Understanding the Data

Q1. Each column contains a:

  • attribute or feature
  • different used car

Q2. How many columns does the dataset have?

  • 26
  • 205

Topic: Python Packages for Data Science

Q1. What description best describes the library Pandas?

  • Includes functions for some advanced math problems as listed in the slide as well as data visualization.
  • Uses arrays as their inputs and outputs. It can be extended to objects for matrices, and with a little change of coding, developers perform fast array processing.
  • Offers data structure and tools for effective data manipulation and analysis. It provides fast access to structured data. The primary instrument of Pandas is a two-dimensional table consisting of columns and rows labels which are called a DataFrame. It is designed to provide an easy indexing function.

Q2. What is a Python library?

  • A file that contains data.
  • A collection of functions and methods that allows you to perform lots of actions without writing your code.

Topic: Importing and Exporting Data in Python

Q1. What does the following method do to the data frame? df : df.head(12)1 point

  • Show the first 12 rows of dataframe.
  • Shows the bottom 12 rows of dataframe.

Q2. What task does the following lines of code perform?

path=’C:\Windows\…\ automobile.csv’

df.to_csv(path)

  • Exports your Pandas dataframe to a new csv file, in the location specified by the variable path.
  • Loads a csv file.

Topic: Getting Started Analyzing Data in Python

Q1. To enable a summary of all the columns, what must the parameter include be set to for the method described?

  • df.describe(include=“all”) 
  • df.describe(include=“None”)

Week 01 Graded Quiz: Importing Datasets

Q1. What do we want to predict from the dataset?

  • price
  • colour
  • make

Q2. What library is primarily used for machine learning

  • scikit-learn
  • Python
  • matplotlib

Q3. We have the list headers_list:

headers_list=['A','B','C']

We also have the data frame df that contains three columns, what is the correct syntax to replace the headers of the data frame df with values in the list headers_list?

  • df.columns = headers_list
  • df.head()
  • df.tail()

Q4. What attribute or method will give you the data type of each column?

  • describe()
  • columns
  • dtypes

Q5. How would you generate descriptive statistics for all the columns for the data frame df?

  • df.describe()
  • df.describe(include = “all”)
  • df.info

Week 02 Practice Quiz: Dealing with Missing Values in Python

Q1. How would you access the column ”body-style” from the data frame df?

  • df[ “body-style”] 
  • df==”bodystyle”

Q2. What is the correct symbol for missing data?

  • nan
  • no-data

Topic: Data Formatting in Python

Q1. How would you rename the column “city_mpg” to “city-L/100km”?

  • df.rename(columns={”city_mpg”: “city-L/100km”}, inplace=True)
  • df.rename(columns={”city_mpg”: “city-L/100km”})

Topic: Data Normalization in Python

Q1. Which of the following is the correct formula for z -score or data standardization?

Q2. What is the maximum value for feature scaling?

  • 1

Topic: Turning categorical variables into quantitative variables in Python

Q1. Consider the column ‘diesel’; what should the value for Car B be?

  • 1

Week 02 Graded Quiz: Data Wrangling

Q1. What task do the following lines of code perform?

avg=df['horsepower'].mean(axis=0)
df['horsepower'].replace(np.nan, avg)
  • calculate the mean value for the ‘horsepower’ column and replace all the NaN values of that column by the mean value
  • nothing; because the parameter inplace is not set to true
  • replace all the NaN values with the mean

Q2. Consider the dataframe df; convert the column df[“city-mpg”] to df[“city-L/100km’] by dividing 235 by each element in the column ‘city-mpg’.

Q3. What data type is the following set of numbers? 666, 1.1,232,23.12

Q4. Consider the two columns ‘horsepower’, and ‘horsepower-binned’; from the data frame df; how many categories are there in the ‘horsepower-binned’ column?

  • 3

Week 03 Practice Quiz: Descriptive Statistics

Q1. Consider the following scatter plot; what kind of relationship do the two variables have?

  • positive linear relationship
  • negative linear relationship

Q2. Which of the following tables representing a number of drive wheels, body style, and the price is a Pivot Table?

Topic: Exploratory Data Analysis

Q1. Consider the dataframe df; what method provides the summary statistics?

  • describe()
  • head()
  • tail()

Q2. If we have 10 columns and 100 samples, how large is the output of df.corr()?

  • 10 x 100
  • 10×10
  • 100×100

Q3. If the p-value of the Pearson Correlation is 1, then …

  • The variables are correlated
  • The variables are not correlated
  • None of the above

Q4. Consider the following dataframe:

1df_test = df[['body-style', 'price']]

The following operation is applied:

1df_grp = df_test.groupby(['body-style'], as_index=False).mean()

What are the resulting values of: df_grp[‘price’]?

  • The average price for each body style
  • The average price
  • The average body style

Q5. What is the Pearson Correlation between variables X and Y, if X=-Y?

  • -1
  • 1
  • 0

Leave a Comment