Question 1 a) What will the following Python statement do? df.drop(df.std()[df.std() == 0].index, axis = 1) Drop
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
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
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill