diff --git a/python/pyarrow/_compute_docstrings.py b/python/pyarrow/_compute_docstrings.py index 079f00db7d9..d42fc6ca4b0 100644 --- a/python/pyarrow/_compute_docstrings.py +++ b/python/pyarrow/_compute_docstrings.py @@ -255,3 +255,66 @@ pyarrow.compute.first pyarrow.compute.last """ + +function_doc_additions["any"] = """ + Examples + -------- + >>> import pyarrow as pa + >>> import pyarrow.compute as pc + >>> arr1 = pa.array([False, True, True]) + >>> pc.any(arr1) + + + Using ``skip_nulls`` to handle null values. + + >>> arr2 = pa.array([False, None, False]) + >>> pc.any(arr2) + + >>> pc.any(arr2, skip_nulls=False) + + + Using ``ScalarAggregateOptions`` to control minimum number of non-null values. + + >>> arr3 = pa.array([], type=pa.bool_()) + >>> pc.any(arr3) + + >>> pc.any(arr3, options=pc.ScalarAggregateOptions(min_count=0)) + + + See Also + -------- + pyarrow.compute.all + """ + +function_doc_additions["all"] = """ + Examples + -------- + >>> import pyarrow as pa + >>> import pyarrow.compute as pc + >>> arr1 = pa.array([True, True, True]) + >>> pc.all(arr1) + + + Using ``skip_nulls`` to handle null values. + + >>> arr2 = pa.array([True, None, True]) + >>> pc.all(arr2) + + >>> pc.all(arr2, skip_nulls=False) + + >>> arr3 = pa.array([False, True]) + >>> pc.all(arr3) + + + Using ``ScalarAggregateOptions`` to control minimum number of non-null values. + + >>> arr4 = pa.array([], type=pa.bool_()) + >>> pc.all(arr4) + + >>> pc.all(arr4, options=pc.ScalarAggregateOptions(min_count=0)) + + + See Also + -------- + pyarrow.compute.any + """