Skip to content

select_dtypes and get_dummies break on duplicate dolumns #20848

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

Closed
kunalgosar opened this issue Apr 27, 2018 · 0 comments · Fixed by #20839
Closed

select_dtypes and get_dummies break on duplicate dolumns #20848

kunalgosar opened this issue Apr 27, 2018 · 0 comments · Fixed by #20839
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@kunalgosar
Copy link
Contributor

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
@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels May 4, 2018
@jreback jreback added this to the 0.23.0 milestone May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants