Skip to content

DOC: update the Series.dt.strftime docstring #20189

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

mircea-cosbuc
Copy link

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:

################################################################################
#################### Docstring (pandas.Series.dt.strftime)  ####################
################################################################################

Format series values with a date format string.

This function formats series values as specified by `date_format`, which
supports the same string format as the python standard library. Details
of the string format can be found in `python string format doc <https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior>`__.

Parameters
----------
date_format : str
    Date format string (e.g. "%Y-%m-%d").

Returns
-------
ndarray of formatted strings

Examples
--------
>>> rng = pd.date_range('10/3/2018 16:20:10', periods=2, freq='H')
>>> rng.strftime("%Y-%m-%d")
array(['2018-10-03', '2018-10-03'], dtype='<U10')

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

Errors found:
        Errors in parameters section
                Parameters {'kwargs', 'args'} not documented
                Unknown parameters {'date_format'}
        See Also section not found

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.

The method is injected with _add_delegate_accessors and the resulting signature on the object has *args and **kwargs instead of the actual date_format

@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Mar 10, 2018
@TomAugspurger TomAugspurger added the Datetime Datetime data dtype label Mar 10, 2018

Parameters
----------
date_format : str
date format string (e.g. "%Y-%m-%d")
Date format string (e.g. "%Y-%m-%d").

Returns
-------
ndarray of formatted strings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be

formatted: ndarray
    NumPy array strings formatted according to `date_format`.

@jreback
Copy link
Contributor

jreback commented Mar 10, 2018

this is a duplicate of #20103 pls coordinate

@jreback jreback removed this from the 0.23.0 milestone Mar 10, 2018
@mircea-cosbuc
Copy link
Author

Closed because of duplication

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.

3 participants