New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select_dtypes and get_dummies break on duplicate dolumns #20848

Closed
kunalgosar opened this Issue Apr 27, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@kunalgosar
Contributor

kunalgosar commented Apr 27, 2018

Functions select_dtypes and get_dummies have strange and incorrect behavior on duplicate column names. Shown below:

In [6]: df
Out[6]: 
  col1 col1
0    1    a
1    2    b

In [7]: df.select_dtypes(include=['int'])
Out[7]: 
Empty DataFrame
Columns: []
Index: [0, 1]

In [8]: pd.get_dummies(df)
Out[8]: 
   col1_('c', 'o', 'l', '1')  col1_('c', 'o', 'l', '1')
0                          1                          1
1                          1                          1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment