Skip to content

Commit

Permalink
Add doc section for list & struct handling (#11770)
Browse files Browse the repository at this point in the history
Fixes: #11011

This PR:

- [x] Adds a side-section for `list` & `struct` handling.
- [x] Reduces duplication.
- [x] Exposes more `ListMethods` APIs.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Ashwin Srinath (https://github.com/shwina)

URL: #11770
  • Loading branch information
galipremsagar authored Sep 26, 2022
1 parent 7a35ed9 commit a945377
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 44 deletions.
2 changes: 2 additions & 0 deletions docs/cudf/source/api_docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ This page provides a list of all publicly accessible modules, methods and classe
io
subword_tokenize
string_handling
list_handling
struct_handling
options
21 changes: 21 additions & 0 deletions docs/cudf/source/api_docs/list_handling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
List handling
~~~~~~~~~~~~~

``Series.list`` can be used to access the values of the series as
lists and apply list methods to it. These can be accessed like
``Series.list.<function/property>``.

.. currentmodule:: cudf.core.column.lists.ListMethods
.. autosummary::
:toctree: api/

astype
concat
contains
index
get
leaves
len
sort_values
take
unique
58 changes: 14 additions & 44 deletions docs/cudf/source/api_docs/series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,6 @@ Timedelta properties
.. include:: string_handling.rst


..
The following is needed to ensure the generated pages are created with the
correct template (otherwise they would be created in the Series/Index class page)
..
.. currentmodule:: cudf
.. autosummary::
:toctree: api/
:template: autosummary/accessor.rst
Series.str
Series.cat
Series.dt
Index.str

.. _api.series.cat:

Categorical accessor
Expand All @@ -349,42 +334,27 @@ the ``Series.cat`` accessor.


.. _api.series.list:

List handling
~~~~~~~~~~~~~

``Series.list`` can be used to access the values of the series as
lists and apply list methods to it. These can be accessed like
``Series.list.<function/property>``.

.. currentmodule:: cudf.core.column.lists.ListMethods
.. autosummary::
:toctree: api/

concat
contains
get
len
sort_values
take
unique
.. include:: list_handling.rst


.. _api.series.struct:
.. include:: struct_handling.rst

Struct handling
~~~~~~~~~~~~~~~

``Series.struct`` can be used to access the values of the series as
Structs and apply struct methods to it. These can be accessed like
``Series.struct.<function/property>``.
..
The following is needed to ensure the generated pages are created with the
correct template (otherwise they would be created in the Series/Index class page)
.. currentmodule:: cudf.core.column.struct.StructMethods
.. autosummary::
:toctree: api/
..
.. currentmodule:: cudf
.. autosummary::
:toctree: api/
:template: autosummary/accessor.rst
field
explode
Series.str
Series.cat
Series.dt
Index.str


Serialization / IO / conversion
Expand Down
13 changes: 13 additions & 0 deletions docs/cudf/source/api_docs/struct_handling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Struct handling
~~~~~~~~~~~~~~~

``Series.struct`` can be used to access the values of the series as
Structs and apply struct methods to it. These can be accessed like
``Series.struct.<function/property>``.

.. currentmodule:: cudf.core.column.struct.StructMethods
.. autosummary::
:toctree: api/

field
explode

0 comments on commit a945377

Please sign in to comment.