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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,26 @@ def strftime(self, date_format):
return np.asarray(self.format(date_format=date_format),
dtype=compat.text_type)
strftime.__doc__ = """
Return an array of formatted strings specified by date_format, which
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 <{0}>`__
of the string format can be found in `python string format doc <{0}>`__.

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`.


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')
""".format("https://docs.python.org/3/library/datetime.html"
"#strftime-and-strptime-behavior")

Expand Down