[Numpy-discussion] changed behavior of numpy.histogram

2008-01-23 Thread Mark.Miller
Greetings: I just noticed a changed behavior of numpy.histogram. I think that a recent 'fix' to the code has changed my ability to use that function (albeit in an unconventional manner). I previously used the histogram function to obtain counts of each unique string within a string array.

Re: [Numpy-discussion] changed behavior of numpy.histogram

2008-01-23 Thread Stuart Brorson
Hi -- Greetings: I just noticed a changed behavior of numpy.histogram. I think that a recent 'fix' to the code has changed my ability to use that function (albeit in an unconventional manner). You can blame me for this. I submitted a patch which prohibited the user from entering any range

Re: [Numpy-discussion] changed behavior of numpy.histogram

2008-01-23 Thread Stuart Brorson
Hi again -- You made me feel guilty about breaking your code. Here's some suggested substitute code : In [10]: import numpy In [11]: a = numpy.array(('atcg', '', 'atcg', 'actg', '')) In [12]: b = numpy.sort(a) In [13]: c = numpy.unique(b) In [14]: d = numpy.searchsorted(b, c) In

Re: [Numpy-discussion] changed behavior of numpy.histogram

2008-01-23 Thread Mark.Miller
Nah...no worries Stuart. Again, I recognize that what I was doing deviated from the likely true intent of the histogram function. But it was a nice convenient bit of code, for sure. I'll take a look at your suggestion...it's different than what I previously used. So, thanks for the input.