Skip to content

Commit

Permalink
ARROW-15429: [Python] Address docstrings for ChunkedArray class, meth…
Browse files Browse the repository at this point in the history
…ods, attributes and constructor

This PR adds docstring examples to:

- `pyarrow.ChunkedArray` class methods and attributes
- `pyarrow.chunked_array`
- `to_pandas` for `_PandasConvertible`

Closes apache#12754 from AlenkaF/ARROW-15429

Lead-authored-by: Alenka Frim <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Signed-off-by: Alessandro Molina <[email protected]>
  • Loading branch information
2 people authored and amol- committed Apr 7, 2022
1 parent 77db0cf commit e5072bd
Show file tree
Hide file tree
Showing 2 changed files with 694 additions and 4 deletions.
16 changes: 16 additions & 0 deletions python/pyarrow/array.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,22 @@ cdef class _PandasConvertible(_Weakrefable):
3 100 Centipede
>>> isinstance(table.to_pandas(), pd.DataFrame)
True
Convert a Chunked Array to pandas Series:
>>> import pyarrow as pa
>>> n_legs = pa.chunked_array([[2, 2, 4], [4, 5, 100]])
>>> n_legs.to_pandas()
0 2
1 2
2 4
3 4
4 5
5 100
dtype: int64
>>> import pandas as pd
>>> isinstance(n_legs.to_pandas(), pd.Series)
True
"""
options = dict(
pool=memory_pool,
Expand Down
Loading

0 comments on commit e5072bd

Please sign in to comment.