Question: Question 1 a) What will the following Python statement do? df.drop(df.std()[df.std() == 0].index, axis = 1) Drop both the categorical and numericalvariables with zero variance
Question 1
a) What will the following Python statement do?
df.drop(df.std()[df.std() == 0].index, axis = 1)
Drop both the categorical and numericalvariables with zero variance
Drop the variables with zero weightedaverage
Drop the numerical variables with zerovariance (or standard deviation)
None of the options
B) Which of the following statements is correct?
If a dataset has a variable in which all therecords are the same, you can drop that variable
If a dataset has a variable in which the majorityof the records are missing (e.g., 90%), you can drop thatvariable
If a dataset has a categorical variable, you needto create new variable(s) to represent that variable withnumbers
All of the options
C) If a dataset has a categorical variable namedoccupation with m levels, how many new dummy variables the codebelow will create?
pd.get_dummies(df['occupation'], drop_first = False)
m
m+1
m-1
None of the options
Step by Step Solution
3.42 Rating (146 Votes )
There are 3 Steps involved in it
Answer a What will the following Python statement do dfdropdfstddfstd 0index axis 1 Ans Drop the num... View full answer
Get step-by-step solutions from verified subject matter experts
