Skip to content

DOC: Add Timestamp, Period, Timedelta, and Interval to api.rst #17424

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 2 commits into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 25 additions & 0 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,15 @@ Categorical Components

.. _api.intervalindex:

Interval
--------

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 add properties and methods for these Scalars? (you might be able to get away with a directive to list all of them, for Period/Interval might be ok, Timestamp will show everything from its inheritied classes). If you can build the docs and show would be great (if there are too many things shown, we might just list some attributes / methods and point to the datetime.datetime docs otherwise.)

Can you also add for Timedelta.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

screenshot from 2017-09-07 02-07-13
Ends up looking like above for Timestamp and Period. There's also room to clarify days_in_month vs daysinmonth as a compatibility alias. It looks like a lot of the existing properties don't need to be there - any guidance on this?

.. autosummary::
:toctree: generated/
:template: autosummary/class_without_autosummary.rst

Interval

IntervalIndex
-------------

Expand Down Expand Up @@ -1567,6 +1576,22 @@ Conversion
DatetimeIndex.to_pydatetime
DatetimeIndex.to_series

Period
------

Copy link
Contributor

Choose a reason for hiding this comment

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

also these need to go in a new section: Scalars I think (alternatively they could go with there associated Indexes), but I think a Scalars section is fine.

.. autosummary::
:toctree: generated/

Period

Timestamp
---------

.. autosummary::
:toctree: generated/

Timestamp

TimedeltaIndex
--------------

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ cdef class _Period(object):

class Period(_Period):
"""
Represents an period of time
Represents a period of time

Parameters
----------
Expand Down