data analysis with python coursera week 2 quiz answers Practice Quiz: Dealing with Missing Values in Python 1. How would you access the column ”body-style" from the dataframe df? Answers df[ “body-style”]df==”bodystyle” 2. What is the correct symbol for missing data? Answers nanno-data Practice Quiz: Data Formatting in Python 3. How would you cast each element in the column "price" to an integer? Answers df[“price”] = int(df[“price”])df[“price”] = df[“price”].astype(“int”) Practice Quiz: Data Normalization in Python 4. What is the maximum value for feature scaling? Answers 1 Practice Quiz: Turning categorical variables into quantitative variables in Python 5. Consider the column 'diesel'; what should the value for Car B be? Answers 01 Graded Quiz: Data Wrangling 6. What task do the following lines of code perform zavg=df['bore'].mean(axis=0)df['bore'].replace(np.nan, avg, inplace= True) Answers calculate the mean value for the ‘bore’ column and replace all the NaN values of that column by the mean valuenothing; because the parameter inplace is not set to true‘horsepower’ 7. How would you rename column name from "highway-mpg" to "highway-L/100km"? Answers df.rename(columns={‘”highway-mpg”‘:’highway-L/100km’}, inplace=True)rename(df,columns={‘”highway-mpg”‘:’highway-L/100km’}) 8. How would you cast the column "losses" to an integer? Answers df[[“losses”]]=df[[“losses”]].astype(“int”)df[[“losses”]].astype(“int”) 9. The following code is an example of:(df["length"]-df["length"].mean())/df["length"].std() Answers simple feature scalingmin-max scalingz-score 10. Consider the two columns 'horsepower', and 'horsepower-binned'; from the dataframe df; how many categories are there in the 'horsepower-binned' column? Answers 3 Share the love Share this content Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window You Might Also Like Week 4 – Course 1 end-of-course project Week 5 – Model Evaluation Course 3 – Data Structures & Backend with Java Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.