Skip to content

DOC: GH39672 Pandas dataframe pct_change function arguments #40266

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

Merged
merged 1 commit into from
Mar 6, 2021

Conversation

ianozsvald
Copy link
Contributor

@ianozsvald ianozsvald commented Mar 6, 2021

@MarcoGorelli MarcoGorelli added this to the 1.3 milestone Mar 6, 2021
@ianozsvald
Copy link
Contributor Author

Running validate_docstrings.py produces:

# python scripts/validate_docstrings.py pandas.DataFrame.pct_change

################################################################################
################### Docstring (pandas.DataFrame.pct_change)  ###################
################################################################################
...
>>> df = pd.DataFrame({
...     '2016': [1769950, 30586265],
...     '2015': [1500923, 40912316],
...     '2014': [1371819, 41403351]},
...     index=['GOOG', 'APPL'])
>>> df
          2016      2015      2014
GOOG   1769950   1500923   1371819
APPL  30586265  40912316  41403351

>>> df.pct_change(axis='columns', periods=-1)
          2016      2015  2014
GOOG  0.179241  0.094112   NaN
APPL -0.252395 -0.011860   NaN

################################################################################
################################## Validation ##################################
################################################################################

1 Errors found:
	The first line of the Returns section should contain only the type, unless multiple values are being returned

Where the last cell with >>> df.pct_change(axis='columns', periods=-1) is the docstring I've updated, prior to making this edit the same "1 Error found" message was generated.

@ianozsvald
Copy link
Contributor Author

Running # ./ci/code_checks.sh yields one failure but this is unrelated (surely?) to my PR so I'm not sure what to do about it?

Doctests computation DONE
Doctests dtypes
..........................................F...................                                                                                                                                                                         [100%]
================================================================================================================== FAILURES ==================================================================================================================
____________________________________________________________________________________________ [doctest] pandas.core.dtypes.dtypes.DatetimeTZDtype _____________________________________________________________________________________________
654     ------
655     pytz.UnknownTimeZoneError
656         When the requested timezone cannot be found.
657 
658     Examples
659     --------
660     >>> pd.DatetimeTZDtype(tz='UTC')
661     datetime64[ns, UTC]
662 
663     >>> pd.DatetimeTZDtype(tz='dateutil/US/Central')
Expected:
    datetime64[ns, tzfile('/usr/share/zoneinfo/US/Central')]
Got:
    datetime64[ns, tzfile('US/Central')]

/home/pandas-ianozsvald/pandas/core/dtypes/dtypes.py:663: DocTestFailure

@ianozsvald
Copy link
Contributor Author

@MarcoGorelli (following up on Gitter but I don't know if you've signed out of there for now) - do I need to do anything or does the perhaps get re-run automatically? I'm not sure what my next step might be? Cheers, Ian.

@MarcoGorelli MarcoGorelli self-requested a review March 6, 2021 20:35
@MarcoGorelli
Copy link
Member

Thanks @ianozsvald - the dtypes doctest check works fine for me running it on your branch, not sure why you were seeing an error. CI failures are unrelated

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

Successfully merging this pull request may close these issues.

Pandas dataframe pct_change function arguments
2 participants