Skip to content

Commit b888a39

Browse files
committed
adjust docstring
1 parent 45b10ca commit b888a39

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
@@ -1926,7 +1926,8 @@ def _hash_pandas_object(
19261926
)
19271927

19281928
def _explode(self) -> tuple[Self, npt.NDArray[np.uint64]]:
1929-
"""Transform each element of list-like to a row.
1929+
"""
1930+
Transform each element of list-like to a row.
19301931
19311932
For arrays that do not contain list-like elements the default
19321933
implementation of this method just returns a copy and an array
@@ -1942,9 +1943,17 @@ def _explode(self) -> tuple[Self, npt.NDArray[np.uint64]]:
19421943
19431944
See Also
19441945
--------
1945-
Series.explode : the method on the ``Series`` object that this
1946+
Series.explode : The method on the ``Series`` object that this
19461947
extension array method is meant to support.
19471948
1949+
Examples
1950+
--------
1951+
>>> import pyarrow as pa
1952+
>>> a = pd.array([[1, 2, 3], [4], [5, 6]], dtype=pd.ArrowDtype(pa.list_(pa.int64())))
1953+
>>> a._explode()
1954+
(<ArrowExtensionArray>
1955+
[1, 2, 3, 4, 5, 6]
1956+
Length: 6, dtype: int64[pyarrow], array([3, 1, 2], dtype=int32))
19481957
"""
19491958
values = self.copy()
19501959
counts = np.ones(shape=(len(self),), dtype=np.uint64)

0 commit comments

Comments
 (0)