Skip to content
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

DEPR: keep_date_col, nested parse_dates in read_csv #56569

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added IO CSV read_csv, to_csv Deprecate Functionality to remove in pandas labels Dec 19, 2023
@mroeschke mroeschke added this to the 2.2 milestone Dec 19, 2023
@mroeschke mroeschke merged commit 38c2877 into pandas-dev:main Dec 19, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@sm-Fifteen
Copy link

What is the rationale for deprecating datetime parsing on combined columns? That's something I personally use a lot (CSV being what it is, date, time of day and timezone offset are often stored in separate columns), and I've not seen equivalent code examples that would achieve the same thing at parsing time.

@mroeschke
Copy link
Member

I've not seen equivalent code examples that would achieve the same thing at parsing time.

Internally pandas didn't do this at parsing time. read_csv would combine parsed columns and use to_datetime essentially with these options. You can achieve the equivalent by using .str.cat with to_datetime

@sm-Fifteen
Copy link

@mroeschke: Using to_datetime is fine for a flat dataframe, but it gets increasingly complicated as indexes and multi-indexes get tossed into the mix. No longer being able to specify those things in the read_csv config so I don't need to think about these afterwards wouldn't be the end of the world, but it's an extra bit of boilerplate index manipulation for some very common situations that I don't currently need to think about, and may pose problems for inexperienced users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants