-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Clarify how date_parser is called (GH9376) #9377
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
I can buy this. @jorisvandenbossche |
Yep, looking good. Although, in reality it is still a little bit more complex, as it are actually three steps that are tried, the first and last the onces you mentioned (vectorized with the columns as input, and scalar with rows), but also vectorized on the concatenated columns into one column. Only, also adding that will make it maybe too complex? @cmeeren Do you also want to add a similar note to the tutorial docs? Somewhere here: http://pandas.pydata.org/pandas-docs/stable/io.html#date-parsing-functions That section could also use a real example I think (of a custom defined function, not of one imported from the io.date_converters module) |
@jorisvandenbossche Just to be clear concerning the second try, where you say it concatenates the columns into one column: If you use two columns, one with values |
I have now mentioned the second way of calling date_parser (assuming my guess in the previous comment was correct) and added a description to the tutorial docs. I have not touched the example, since I have little experience with the Sphinx-IPython combo. |
@cmeeren actually, I think you should mention So it is MUCH more performant to use |
@jreback are you suggesting that I mention |
no! this is in lieu of using date_parser entirely |
I don't really understand the role of |
@jreback finishing my comment: indeed, in many case BTW, you can use |
so the simple heuristic is this:
so a naked |
@cmeeren so what I think we should do is update the doc-string a bit (what you have is prob good). then add a section to the docs in the date parsing section giving the relative list as above. |
@jreback yes, that is a nice overview of steps to follow! The full docs on the date parsing can use an overhaul. It is now scattered a bit:
where the first is not adjacent to the other three. I would have just one section with some subsections. @cmeeren If you want, you can certainly try to tackle this! Otherwise, we just merge this as is (as it is correct information) and open a new issue for it. |
First I'll correct things based on the recent feedback here. The information I added as it currently stands is not correct (specifically regarding the second "concatenation" call). |
I added the list provided by @jreback. Please check the PR diff now and see if the information is good. |
an exception is raised, the next one is tried: | ||
|
||
1. ``date_parser`` is first called with one or more arrays as arguments, | ||
as defined using `parse_dates` (e.g., ``date_parser(['2013', '2013']``, ``['1', '2'])``) |
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.
Here the ```` in the middle of the date_parser(..) example should be removed I think
This looks good for me! Apart from the one small comment, can you also squash your commits into one? |
I addressed the comment and I think I managed to squash the commits now. |
Thanks a lot! |
DOC: Clarify how date_parser is called (GH9376)
closes #9376