-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC add to_datetime to api.rst #3859
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
Conversation
there should be an example in timeseries.rst and/or basics.rst |
should be generated by the API docs. grin shows nothing in those that @jreback just mentioned |
@jreback http://pandas.pydata.org/pandas-docs/dev/search.html?q=to_datetime&check_keywords=yes&area=default only result is "what's new". Should one go in basics or timeseries? (I'd vote for basics.) |
I would put near the top of timeseries (before time spans) |
Can I include unit ? :) |
yeh...goign to merge that right now in fact...... I think its a reasonable api, yes? |
units defined in #3818 |
@hayd fyi...I believe that |
I was worried this was going to be a barrel of worms. maybe there is a reason this function isn't documented... :p |
is it a barrel? |
Nah... putting something together now. (sorry, just got flustered with above issue) |
Also that dayfirst isn't strict. :S |
I don't think this is ready yet |
k |
It could be merged as is, it would at least get I've written "something" about using |
I've done a little more on this, feedback welcome... |
|
||
.. ipython:: python | ||
|
||
to_datetime(['2009-07-31', 'asd']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably could add something about raise here. (Also, I really dislike that this is default behaviour)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do u think that it should convert by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think errors='raise'
should be the default...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi...changing errors='raise'
in theory a good idea, but breaks bunch of stuff.....will have to decide on that later...otherwise this looks ready?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just rebased, so will check I'm not saying anything stupid and then merge...
|
|
@cpcloud woah! I'd never done: |
That is also strange, and the thing which means that |
this is good! see #3890, which resolves almost all of the inconsistencies |
Ah cool! Didn't realise hasn't been merged yet! :) |
|
||
To convert a Series or list-like object of date-like objects e.g. strings, | ||
epochs, or a mixture, you can use the ``to_datetime`` function. When passed | ||
a Series, this returns a Series (with the same index), whilst a list-like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whilst -> while?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
This is still whacky: |
so will mention it |
not sure there's any other way to go about it. need to use ints for representation but want to be able to parse semi human readable dates and |
can u add that last to #3944? I think we are all agreed that the default to_ datetime should be more strict |
done |
that why I separated out #3944 dateutil lets everything thru so have to do some most common case parsing first need to expand c date parser then can pretty much drop need for dateutil except as fallback |
(and it's not strict for dayfirst grrr!) |
Quick once over of this? |
looks good |
Converting to Timestamps | ||
------------------------ | ||
|
||
To convert a Series or list-like object of date-like objects e.g. strings, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of likes and objects here, but I think it'll do
mergable? |
I'm still meh on the first line, but I think it's fine. |
Either I'm being thick or
to_datetime
isn't in the docs (does adding it like this add it?)Should also put something in basics...?