-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Allow Arrow types directly with pd.to_datetime #58220
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
Comments
I'm very skeptical of making pd.to_datetime more complicated (both as an API and the implementation).
Side-note: I've been kicking around the idea of a pd.to.foo namespace to collect all of the to_foo functions, since the top-level namespace is pretty big. ATM to_offset and to_time are buried and could be included. |
|
I wasnt aware of the keyword in to_numeric; I would have been -0.75 on that. In to_datetime it has the added downside of complicating the return type (not just dtype). The base case to_datetime returns a DatetimeIndex. A keyword would change that to be a base class Index. .convert_dtypes already works for the timestamp dtypes. One Obvious Way. |
I also think
That's in interesting idea but I think would be really tough to roundtrip and use effectively with our I/O AFAIU the only way to specifically get a non-object date in this case is to |
Correct |
This is a good point. |
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
When users just want dates, the first thing they might try is:
But that unfortunately returns dtype=object
An arguably better approach would be something like
But has the disadvantage of taking an extra step to get the desired type
Feature Description
Should we add an arrow backend/family argument to pd.to_datetime? Alternately maybe we need to introduce a new
pd.to_date
function? @jbrockmendel curious what you might thinkAlternative Solutions
n/a
Additional Context
No response
The text was updated successfully, but these errors were encountered: