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
Step: 1
Answer a What will the following Python statement do dfdropdfstddfstd 0index axis 1 Ans Drop the num...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started