Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Electrical Engineering questions

Question

What is the difference between DAO and RDO?

Answered: 1 week ago