xtensor
 
Loading...
Searching...
No Matches
Digitize helpers

Helpers for assigning values to histogram bins. More...

Functions

template<class E1, class E2>
auto xt::digitize (E1 &&data, E2 &&bin_edges, bool right=false)
 Return the indices of the bins to which each value in input array belongs.
 

Detailed Description

Helpers for assigning values to histogram bins.

Function Documentation

◆ digitize()

template<class E1, class E2>
auto xt::digitize ( E1 && data,
E2 && bin_edges,
bool right = false )
inline

Return the indices of the bins to which each value in input array belongs.

Parameters
dataThe data.
bin_edgesThe bin-edges. It has to be 1-dimensional and monotonic.
rightIndicating whether the intervals include the right or the left bin edge.
Returns
Output array of indices, of same shape as x.

Definition at line 41 of file xhistogram.hpp.