66
77An :external+xarray:doc: `accessor <internals/extending-xarray >` is provided to
88ease manipulation and analysis of the histogram outputs. Simply import
9- :mod: `xarray_histogram.accessor ` to register it. It will then be available for
10- all DataArrays that meet some conditions (see below), under the `` hist ``
11- attribute. It gives access to a number of methods. ::
9+ :mod: `xarray_histogram.accessor ` to register it. It will then be available under
10+ the `` hist `` attribute for all DataArrays that meet some conditions (see below).
11+ It gives access to a number of methods. ::
1212
1313 import xarray_histogram as xh
1414 import xarray_histogram.accessor
@@ -17,15 +17,17 @@ attribute. It gives access to a number of methods. ::
1717
1818 h.hist.median()
1919
20- Operations are vectorized [ #vector ]_, so that you can apply them to entire
20+ Operations are vectorized so that you can apply them to entire
2121arrays of histograms. For instance for data defined along time, latitude and
2222longitude, we can compute one histogram per time-step::
2323
2424 >>> h = xh.histogram(data, dims=["lon", "lat"])
2525 >>> h.hist.median()
2626 will be of dimensions ("time",)
2727
28- .. [#vector ] Computations are automatically vectorized in Python with
28+ .. note ::
29+
30+ Computations are automatically vectorized in Python with
2931 :func: `xarray.apply_ufunc `, which is not efficient for a large number of
3032 histograms.
3133
@@ -56,7 +58,7 @@ Each bins coordinate may contain attributes:
5658
5759Those conventions are coherent with the output of
5860``xarray_histogram.histogram* ``, so if you use this package functions you
59- should not have to worry. The names of the array and coordinates is also
61+ should not have to worry. The names of the array and coordinates are also
6062consistent with that of :external+xhistogram:doc: `xhistogram <index >`
6163(although coordinates attributes will be missing).
6264
@@ -85,11 +87,11 @@ excluded by passing ``flow=False``.
8587 bins. The overflow bins centers are the same as their position (``np.inf `` for
8688 instance).
8789
88- * :meth: `~.HistDataArrayAccessor.areas ` returns the areas of multidimensional
89- bins . This is the product of the widths of all bins. Only some variable can be
90- specified. The areas of points that correspond to a flow bin in at least one
91- dimension is equal to one. For instance for a 2D-histogram with underflow and
92- overflow bins, all the borders of the 2D array for areas will be equal to 1.
90+ * :meth: `~.HistDataArrayAccessor.areas ` returns the areas corresponding to each
91+ histogram point . This is the outer product of the widths of all bins. The
92+ areas of points that correspond to a flow bin in at least one dimension is
93+ equal to one. For instance for a 2D-histogram with underflow and overflow
94+ bins, all the borders of the 2D array for areas will be equal to 1.
9395
9496To remove flow bins, :meth: `~.HistDataArrayAccessor.remove_flow ` will returns a
9597new histogram DataArray without the flow bins of the given variables (by default
@@ -102,9 +104,9 @@ Bins transform
102104
103105Arbitrary functions can be applied to bins with
104106:meth: `~.HistDataArrayAccessor.apply_func `. The result is equivalent to
105- computing an histogram of ``func(data["variable"]) ``. The function must
107+ computing the histogram of ``func(data["variable"]) ``. The function must
106108transform the N+1 edges given as a DataArray. There is no need to account for
107- the *right_edge * attribute.
109+ the *right_edge * attribute or flow bins .
108110
109111For instance, :meth: `~.HistDataArrayAccessor.scale ` scales bins by a given
110112factor. It essential does ``hist.apply_func(lambda edges: edges * factor) ``
@@ -115,7 +117,7 @@ Normalization
115117
116118The histogram can be normalized to a probability density function if not
117119already, using :meth: `~.HistDataArrayAccessor.normalize `. Note that for a
118- N-dimensional histogram, this function can normalize only along some variables.
120+ N-dimensional histogram, this function can normalize along only some variables.
119121
120122The accessor considers the histogram normalized or not given the name of its
121123DataArray: normalized if named ``<variables>_pdf `` and non-normalized
0 commit comments