mrgou
mrgou

Reputation: 2488

TypeError: get_dummies() got an unexpected keyword argument 'drop_first'

Here's something I dont understand. When I run this:

dataframe['col_name'].str.get_dummies(sep='|', drop_first=True)

I get: TypeError: get_dummies() got an unexpected keyword argument 'drop_first' which makes no sense to me when I read this...

I must be missing something. Can anyone help?

Upvotes: 1

Views: 1549

Answers (1)

NYC Coder
NYC Coder

Reputation: 7604

There are 2 get_dummies:

  1. pandas.get_dummies
  2. pandas.Series.str.get_dummies

The one you are using is the second one which does not have drop_first

Upvotes: 1

Related Questions