Skip to content

Commit 48148c1

Browse files
committed
adjust docstring
1 parent f8a6911 commit 48148c1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pandas/core/arrays/base.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,8 @@ def _hash_pandas_object(
19321932
)
19331933

19341934
def _explode(self) -> tuple[Self, npt.NDArray[np.uint64]]:
1935-
"""Transform each element of list-like to a row.
1935+
"""
1936+
Transform each element of list-like to a row.
19361937
19371938
For arrays that do not contain list-like elements the default
19381939
implementation of this method just returns a copy and an array
@@ -1948,9 +1949,17 @@ def _explode(self) -> tuple[Self, npt.NDArray[np.uint64]]:
19481949
19491950
See Also
19501951
--------
1951-
Series.explode : the method on the ``Series`` object that this
1952+
Series.explode : The method on the ``Series`` object that this
19521953
extension array method is meant to support.
19531954
1955+
Examples
1956+
--------
1957+
>>> import pyarrow as pa
1958+
>>> a = pd.array([[1, 2, 3], [4], [5, 6]], dtype=pd.ArrowDtype(pa.list_(pa.int64())))
1959+
>>> a._explode()
1960+
(<ArrowExtensionArray>
1961+
[1, 2, 3, 4, 5, 6]
1962+
Length: 6, dtype: int64[pyarrow], array([3, 1, 2], dtype=int32))
19541963
"""
19551964
values = self.copy()
19561965
counts = np.ones(shape=(len(self),), dtype=np.uint64)

0 commit comments

Comments
 (0)