Re: [Numpy-discussion] Optimized np.digitize for equidistant bins

2020-12-18 Thread Martín Chalela
Thank you Joseph El vie, 18 dic 2020 a las 16:56, Joseph Fox-Rabinovitz (< jfoxrabinov...@gmail.com>) escribió: > There is: np.floor_divide. > > On Fri, Dec 18, 2020, 14:38 Martín Chalela > wrote: > >> Right! I just thought there would/should be a "digitize"

Re: [Numpy-discussion] Optimized np.digitize for equidistant bins

2020-12-18 Thread Martín Chalela
Right! I just thought there would/should be a "digitize" function that did this. El vie, 18 dic 2020 a las 14:16, Joseph Fox-Rabinovitz (< jfoxrabinov...@gmail.com>) escribió: > Bin index is just value floor divided by the bin size. > > On Fri, Dec 18, 2020, 09:5

[Numpy-discussion] Optimized np.digitize for equidistant bins

2020-12-18 Thread Martín Chalela
Hi all! I was wondering if there is a way around to using np.digitize when dealing with equidistant bins. For example: bins = np.linspace(0, 1, 20) The main problem I encountered is that digitize calls np.searchsorted. This is the correct way, I think, for generic bins, i.e. bins that have differe