amol- commented on a change in pull request #1:
URL: https://github.com/apache/arrow-cookbook/pull/1#discussion_r676489280



##########
File path: python/source/data.rst
##########
@@ -0,0 +1,139 @@
+=================
+Data Manipulation
+=================
+
+Recipes related to filtering or transforming data in
+arrays and tables.
+
+.. contents::
+
+See :ref:`compute` for a complete list of all available compute functions
+
+Computing Mean/Min/Max values of an array
+=========================================
+
+Arrow provides compute functions that can be applied to arrays.
+Those compute functions are exposed through the :mod:`arrow.compute`
+module.
+
+.. testsetup::
+
+  import numpy as np
+  import pyarrow as pa
+
+  arr = pa.array(np.arange(100))
+
+Given an array with all numbers from 0 to 100
+
+.. testcode::
+
+  print(f"{arr[0]} .. {arr[-1]}")
+
+.. testoutput::
+
+  0 .. 99
+
+We can compute the ``mean`` using the :func:`arrow.compute.mean`
+function
+
+.. testcode::
+
+  import pyarrow.compute as pc
+
+  mean = pc.mean(arr)
+  print(mean)
+
+.. testoutput::
+
+  49.5
+
+And the ``min`` and ``max`` using the :func:`arrow.compute.min_max`
+function
+
+.. testcode::
+
+  import pyarrow.compute as pc
+
+  min_max = pc.min_max(arr)
+  print(min_max)
+
+.. testoutput::
+
+  {'min': 0, 'max': 99}
+
+Counting Occurrences of Elements
+================================
+
+Arrow provides compute functions that can be applied to arrays,
+those compute functions are exposed through the :mod:`arrow.compute`
+module.
+
+.. testsetup::
+
+  import pyarrow as pa
+
+  nums_arr = pa.array(list(range(10))*10)
+
+Given an array with all numbers from 0 to 10 repeated 10 times

Review comment:
       rephrased




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to