Never mind this, it was my own mistake as I expected :-)
def __chunk(n,size):
x = range(0,n,size)
x.append(n)
return zip(x[:-1],x[1:])
makes it a lot better :)
Sturla
Den 18.01.2012 06:26, skrev Sturla Molden:
> While "playing" with a point-in-polygon test, I have discovered s
While "playing" with a point-in-polygon test, I have discovered some a
failure mode that I cannot make sence of.
The algorithm is vectorized for NumPy from a C and Python implementation
I found on the net (see links below). It is written to process a large
dataset in chunks. I'm rather happy w
Here's a thought:
Too bad numpy doesn't have a 24 bit integer, but you could tack a 0
on, making your image 32 bit, then use histogram2d to count the
colors.
something like (untested):
# create the 32 bit image
32bit_im = np.zeros((w, h), dtype = np.uint32)
view = 32bit_im.view(dtype = np.uint8)
On Tue, Jan 17, 2012 at 8:57 AM, Adam Klein wrote:
> Hello,
>
> I get a segfault here:
>
> In [1]: x = np.array([1,2,3], dtype='M')
> In [2]: x.searchsorted(2, side='left')
>
> But it's fine here:
>
> In [1]: x = np.array([1,2,3], dtype='M')
> In [2]: x.view('i8').searchsorted(2, side='left')
> O
Hello,
I get a segfault here:
In [1]: x = np.array([1,2,3], dtype='M')
In [2]: x.searchsorted(2, side='left')
But it's fine here:
In [1]: x = np.array([1,2,3], dtype='M')
In [2]: x.view('i8').searchsorted(2, side='left')
Out[2]: 1
This segfaults again:
x.view('i8').searchsorted(np.datetime64(
On Tue, Jan 17, 2012 at 05:11, Andreas Kloeckner
wrote:
> Hi Robert,
>
> On Fri, 30 Dec 2011 20:05:14 +, Robert Kern wrote:
>> On Fri, Dec 30, 2011 at 18:57, Andreas Kloeckner
>> wrote:
>> > Hi Robert,
>> >
>> > On Tue, 27 Dec 2011 10:17:41 +, Robert Kern
>> > wrote:
>> >> On Tue, Dec