Skip to content

Index.to_datetime() has no format keyword #5612

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
jorisvandenbossche opened this issue Nov 28, 2013 · 4 comments
Closed

Index.to_datetime() has no format keyword #5612

jorisvandenbossche opened this issue Nov 28, 2013 · 4 comments
Labels
API Design Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jorisvandenbossche
Copy link
Member

Index.to_datetime has no format keyword (and more generally, it lacks all keyword arguments from pd.to_datetime except for dayfirst).

Maybe it could be made more similar to pd.datetime? (or even just use it under the hood?)

Code: https://github.com/pydata/pandas/blob/master/pandas/core/index.py#L278
Docs: http://pandas.pydata.org/pandas-docs/dev/generated/pandas.Index.to_datetime.html#pandas.Index.to_datetime

Thanks to @stijnvanhoey for reporting

@jreback
Copy link
Contributor

jreback commented Nov 28, 2013

this shouldn't even be a method, I think should drop it; to_datetime is much more general in any event

@jorisvandenbossche
Copy link
Member Author

Removing is maybe difficult, as it there already a long time (#208)? Or with deprecation it is no problem?

But maybe making it a simple wrapper around pd.to_datetime like self.index = pd.datetime(self.index, **kwds)? And not advertising it in the docs could be starter (it is listed in the api docs).

@jorisvandenbossche
Copy link
Member Author

Another question, what is the usage of DatetimeIndex.to_datetime?

@jreback
Copy link
Contributor

jreback commented Nov 28, 2013

yep deprecate and wrap would eork

@jreback jreback modified the milestones: 0.15.0, 0.14.0 Apr 6, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 3, 2015
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.19.0, Next Major Release Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

No branches or pull requests

2 participants