[Numpy-discussion] Indexing bug in structured arrays(?)

2011-04-02 Thread Chris Fonnesbeck
I am either getting a nasty bug when indexing structured arrays, or I don't really understand how they work. I have imported some data using genfromtxt and an associated list of dtypes: ndtype=[('include', int), ('year', int), ('month', int), ('day', int), ('deg_day_north', int), ('deg_day_south',

Re: [Numpy-discussion] unpack argument in loadtxt/genfromtxt does not work as documented

2010-10-07 Thread Chris Fonnesbeck
On Thu, Oct 7, 2010 at 8:59 AM, Pierre GM wrote: > > Not needed. The unpack argument is used as the very end of the function > anyway. > Anyhow, could you open a ticket to that effect (else I'm quite likely to > forget about it). > I can open this one. __

Re: [Numpy-discussion] unpack argument in loadtxt/genfromtxt does not work as documented

2010-10-07 Thread Chris Fonnesbeck
On Thu, Oct 7, 2010 at 4:00 AM, Pierre GM wrote: > > On Oct 7, 2010, at 4:48 AM, Chris Fonnesbeck wrote: > >> The documentation for loadtxt and genfromtxt state that the unpack >> argument functions as follows: >> >> If True, the returned array is transposed, so

[Numpy-discussion] unpack argument in loadtxt/genfromtxt does not work as documented

2010-10-06 Thread Chris Fonnesbeck
The documentation for loadtxt and genfromtxt state that the unpack argument functions as follows: If True, the returned array is transposed, so that arguments may be unpacked using x, y, z = loadtxt(...). In practice, this does not always occur. I have a csv file of mixed data types, and try impo

[Numpy-discussion] problems generating negative binomials

2008-08-22 Thread Chris Fonnesbeck
I'm trying to generate negative binomial random numbers where the n parameter is non integer (<1 in fact). This should be possible, as n only needs to be real. However, I get the following message: ValueError: n <= 0 I assume this is because some rounding is going on behind the scenes. The reas

Re: [Numpy-discussion] generating float sequences

2008-08-22 Thread Chris Fonnesbeck
Chris Fonnesbeck mac.com> writes: > It would be great to be able to do the following: > > arange(0, 100, 0.1) As it turns out, I am an idiot. Apologies. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projec

[Numpy-discussion] generating float sequences

2008-08-22 Thread Chris Fonnesbeck
Is there any prospect for easily getting ranges of floats in numpy, rather than just integers? In R, for example, you can specify a decimal value for the step size. It would be great to be able to do the following: arange(0, 100, 0.1) for a sequence from 0 to 100 in steps of 0.1. It seems rather

[Numpy-discussion] Vectorize leaks

2007-08-13 Thread Chris Fonnesbeck
I have narrowed a memory leak in PyMC down to the vectorize() function in numpy. I have a simple inverse logit transformation function: invlogit = lambda x: 1.0 / (1.0 + exp(-1.0 * x)) which runs without leaking when used iteratively during simulations. However, when I try to vectorize it, the