Skip to content

Update : In DataFrame Class, Columns should not contain duplicate val… #34512

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
wants to merge 1 commit into from
Closed

Conversation

MohakGangwani
Copy link

@MohakGangwani MohakGangwani commented Jun 1, 2020

Also updated the Docstring.(#12991)

@pep8speaks
Copy link

Hello @MohakGangwani! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 360:70: W291 trailing whitespace
Line 447:1: W293 blank line contains whitespace
Line 448:9: E265 block comment should start with '# '
Line 449:20: E711 comparison to None should be 'if cond is not None:'

@dsaxton
Copy link
Member

dsaxton commented Jun 3, 2020

I don't think this is addressing the original issue. DataFrames can have columns with duplicate labels, the problem is when trying to modify only one.

@MohakGangwani
Copy link
Author

Wouldn't it be better if pandas didn't allow us to have duplicate column names ? Having columns with same name would rather create confusion for us.
Plus, this may avoid the issue #12991

@dsaxton
Copy link
Member

dsaxton commented Jun 4, 2020

Wouldn't it be better if pandas didn't allow us to have duplicate column names ? Having columns with same name would rather create confusion for us.
Plus, this may avoid the issue #12991

Probably yes, there's a WIP PR about not allowing duplicate labels #28394

@MarcoGorelli
Copy link
Member

Thanks @MohakGangwani

AFAICT, #28394 would already address the issue of optionally disallowing duplicate column labels. Suddenly raising an exception without any prior warning wouldn't be good form - furthermore, you would need to add tests for this new behaviour.

Closing for now then as this looks like it's inactive and probably not the solution pandas would want to go with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants