Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

disouzaleo
Copy link

@disouzaleo disouzaleo commented Mar 10, 2018

Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

  • PR title is "DOC: update the docstring"
  • The validation script passes: scripts/validate_docstrings.py <your-function-or-method>
  • The PEP8 style check passes: git diff upstream/master -u -- "*.py" | flake8 --diff
  • The html version looks good: python doc/make.py --single <your-function-or-method>
  • It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

# paste output of "scripts/validate_docstrings.py <your-function-or-method>" here
# between the "```" (remove this comment, but keep the "```")

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):

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

Hello @Lrodlima! Thanks for submitting the PR.

Line 5404:43: W291 trailing whitespace
Line 5405:1: W293 blank line contains whitespace
Line 5406:80: E501 line too long (102 > 79 characters)
Line 5407:80: E501 line too long (106 > 79 characters)
Line 5408:1: W293 blank line contains whitespace
Line 5410:1: W293 blank line contains whitespace
Line 5416:80: E501 line too long (102 > 79 characters)
Line 5434:80: E501 line too long (134 > 79 characters)
Line 5441:80: E501 line too long (82 > 79 characters)
Line 5442:62: W291 trailing whitespace
Line 5456:1: W293 blank line contains whitespace

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Mar 10, 2018

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')]
Copy link
Member

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)
Copy link
Member

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'))
Copy link
Member

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
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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

@jreback jreback added Docs Datetime Datetime data dtype labels Mar 10, 2018
@jorisvandenbossche
Copy link
Member

@Lrodlima do you have time to update the PR based on the feedback?

@datapythonista datapythonista self-assigned this Aug 21, 2018
@datapythonista
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants