Skip to content

Commit ed1d61e

Browse files
DOC: fix api documentation for accessors
1 parent b947366 commit ed1d61e

File tree

3 files changed

+55
-12
lines changed

3 files changed

+55
-12
lines changed
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{ fullname }}
2+
{{ underline }}
3+
4+
.. currentmodule:: {{ module.split('.')[0] }}
5+
6+
.. automethod:: {{ [module.split('.')[1], objname]|join('.') }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{ fullname }}
2+
{{ underline }}
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}

doc/source/api.rst

+43-12
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ These can be accessed like ``Series.dt.<property>``.
468468
Series.dt.microsecond
469469
Series.dt.nanosecond
470470
Series.dt.second
471+
Series.dt.week
471472
Series.dt.weekofyear
472473
Series.dt.dayofweek
473474
Series.dt.weekday
@@ -479,6 +480,10 @@ These can be accessed like ``Series.dt.<property>``.
479480
Series.dt.is_quarter_end
480481
Series.dt.is_year_start
481482
Series.dt.is_year_end
483+
Series.dt.daysinmonth
484+
Series.dt.days_in_month
485+
Series.dt.tz
486+
Series.dt.freq
482487

483488
**Datetime Methods**
484489

@@ -551,6 +556,7 @@ strings and apply several methods to it. These can be acccessed like
551556
Series.str.strip
552557
Series.str.title
553558
Series.str.upper
559+
Series.str.wrap
554560
Series.str.zfill
555561
Series.str.isalnum
556562
Series.str.isalpha
@@ -563,29 +569,49 @@ strings and apply several methods to it. These can be acccessed like
563569
Series.str.isdecimal
564570
Series.str.get_dummies
565571

572+
..
573+
The following is needed to ensure the generated pages are created with the
574+
correct template (otherwise they would be created in the Series class page)
575+
576+
..
577+
.. autosummary::
578+
:toctree: generated/
579+
:template: autosummary/accessor.rst
580+
581+
Series.str
582+
Series.cat
583+
Series.dt
584+
585+
566586
.. _api.categorical:
567587

568588
Categorical
569589
~~~~~~~~~~~
570590

571591
If the Series is of dtype ``category``, ``Series.cat`` can be used to change the the categorical
572592
data. This accessor is similar to the ``Series.dt`` or ``Series.str`` and has the
573-
following usable methods and properties (all available as ``Series.cat.<method_or_property>``).
593+
following usable methods and properties:
594+
595+
.. autosummary::
596+
:toctree: generated/
597+
:template: autosummary/accessor_attribute.rst
598+
599+
Series.cat.categories
600+
Series.cat.ordered
601+
Series.cat.codes
574602

575603
.. autosummary::
576604
:toctree: generated/
605+
:template: autosummary/accessor_method.rst
577606

578-
Categorical.categories
579-
Categorical.ordered
580-
Categorical.rename_categories
581-
Categorical.reorder_categories
582-
Categorical.add_categories
583-
Categorical.remove_categories
584-
Categorical.remove_unused_categories
585-
Categorical.set_categories
586-
Categorical.as_ordered
587-
Categorical.as_unordered
588-
Categorical.codes
607+
Series.cat.rename_categories
608+
Series.cat.reorder_categories
609+
Series.cat.add_categories
610+
Series.cat.remove_categories
611+
Series.cat.remove_unused_categories
612+
Series.cat.set_categories
613+
Series.cat.as_ordered
614+
Series.cat.as_unordered
589615

590616
To create a Series of dtype ``category``, use ``cat = s.astype("category")``.
591617

@@ -594,8 +620,13 @@ adding ordering information or special categories is need at creation time of th
594620

595621
.. autosummary::
596622
:toctree: generated/
623+
:template: autosummary/class_without_autosummary.rst
597624

598625
Categorical
626+
627+
.. autosummary::
628+
:toctree: generated/
629+
599630
Categorical.from_codes
600631

601632
``np.asarray(categorical)`` works by implementing the array interface. Be aware, that this converts

0 commit comments

Comments
 (0)