AlenkaF commented on code in PR #12754:
URL: https://github.com/apache/arrow/pull/12754#discussion_r843820490
##########
python/pyarrow/table.pxi:
##########
@@ -357,6 +509,29 @@ cdef class ChunkedArray(_PandasConvertible):
Returns
-------
cast : Array or ChunkedArray
+
+ Examples
+ --------
+ >>> import pyarrow as pa
+ >>> n_legs = pa.chunked_array([[2, 2, 4], [4, 5, 100]])
+ >>> n_legs.type
+ DataType(int64)
+ >>> n_legs.cast(pa.duration('s')).type
+ DurationType(duration[s])
+ >>> n_legs.cast(pa.duration('s'))
+ <pyarrow.lib.ChunkedArray object at ...>
+ [
+ [
+ 2,
+ 2,
+ 4
+ ],
+ [
+ 4,
+ 5,
+ 100
+ ]
+ ]
Review Comment:
Sure, can do. I will also divide the example with text so it will be
clearer. What I can also do is remove the last call `>>>
n_legs.cast(pa.duration('s'))` altogether.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]