-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
read_csv/pl.Dataframe.rename broken?! #2004
Comments
Yes, this is correct. A polars dataframe may only have unique column names. This was not checked at renaming before polars 0.10.27, but this was a bug. So as the error message shows, your rename leads to duplicate column names. |
woah... what? so we can't read in data (csv, parquet) that have duplicate column names? |
You could not create a DataFrame from them no. Polars would throw an error saying that the unique columns invariant is broken. Same like you cannot create a database table with duplicate columns. Just out of curiosity? Why do you want to rename columns to the same name? |
This is great. Sorry to chime in, just wanted to point out that duplicate columns have lead to some very tricky bugs in pandas (e.g. here), so for what it's worth I'm hoping that polars will continue to disallow them |
Are you using Python or Rust?
Python
What version of polars are you using?
0.10.27
What operating system are you using polars on?
windows 10
Describe your bug.
the newest version (0.10.27) is not able to read/rename csv with same column names but different values
expected behavior?
The text was updated successfully, but these errors were encountered: