-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Series as of docstring #20226
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
Series as of docstring #20226
Conversation
Hello @Lrodlima! Thanks for submitting the PR.
|
Can you please follow the instructions? (edit the PR title, paste the output of the validation scripts, make sure the PEP8 check passes) |
... datetime.strptime('20140101', '%Y%m%d'), | ||
... datetime.strptime('20150101', '%Y%m%d'), | ||
... datetime.strptime('20150101', '%Y%m%d'), | ||
... datetime.strptime('20160101', '%Y%m%d')] |
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.
you can generate some dates with pd.date_range
(if you want a regular index), or pd.to_datetime.
... datetime.strptime('20150101', '%Y%m%d'), | ||
... datetime.strptime('20150101', '%Y%m%d'), | ||
... datetime.strptime('20160101', '%Y%m%d')] | ||
>>> mySeries = pd.Series(data=names, index=dates) |
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.
you can call the series s
... datetime.strptime('20150101', '%Y%m%d'), | ||
... datetime.strptime('20160101', '%Y%m%d')] | ||
>>> mySeries = pd.Series(data=names, index=dates) | ||
>>> mySeries.asof(datetime.strptime('20150102', '%Y%m%d')) |
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.
Can you use pd.Timestamp("2015-01-02")
instead? (to use the pandas equivalent way)
if not None use these columns for NaN propagation | ||
where : datetime | ||
Date or array of dates. | ||
subset : str |
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.
subset: str or list of strings
if not None, use the columns for NaN propagation.
|
||
Notes | ||
----- | ||
Dates are assumed to be sorted | ||
Raises if this is not the case | ||
Dates are assumed to be sorted. |
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.
can you make a Raises section and add ValueError there (if dates are not sorted)
|
||
Examples | ||
-------- | ||
>>> import pandas as pd |
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.
don't need pandas import
@Lrodlima do you have time to update the PR based on the feedback? |
Seems like this is duplicate work with #21034, which is a bit more complete. Closing this one. Thanks @Lrodlima for the work, and sorry about the lack of synchronization. |
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):
scripts/validate_docstrings.py <your-function-or-method>
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single <your-function-or-method>
Please include the output of the validation script below between the "```" ticks:
If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.
Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):
git diff upstream/master -u -- "*.py" | flake8 --diff