[Numpy-discussion] genfromtxt and gzip

2013-06-05 Thread Ted To
Hi all, >From the list archives (2011), I noticed that there is a bug in the python gzip module that causes genfromtxt to fail with python 2 but this bug is not a problem for python 3. When I tried to use genfromtxt and python 3 with a gzip'ed csv file, I instead got: IOError: Mode rbU not suppo

Re: [Numpy-discussion] Addressing arrays

2012-01-30 Thread Ted To
> You'd want to update your mask appropriately to get everything you > want to select, one criteria at a time e.g.: > mask = a[:,0] == 1 > mask &= a[:,1] == 1960 > > Alternatively: > mask = (a[:,0] == 1) & (a[:,1] == 1960) > but be careful with the parens, & and | are normally high-priority > bitw

Re: [Numpy-discussion] Addressing arrays

2012-01-30 Thread Ted To
On 01/30/2012 12:13 PM, Brett Olsen wrote: > On Mon, Jan 30, 2012 at 10:57 AM, Ted To wrote: >> Sure thing. To keep it simple suppose I have just a two dimensional >> array (time,output): >> [(1,2),(2,3),(3,4)] >> I would like to look at all values of output for

Re: [Numpy-discussion] Addressing arrays

2012-01-30 Thread Ted To
t index. >> >> 2012/1/30 Zachary Pincus >> a[x,y,:] >> >> Read the slicing part of the tutorial: >> http://www.scipy.org/Tentative_NumPy_Tutorial >> (section 1.6) >> >> And the documentation: >> http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html

[Numpy-discussion] Addressing arrays

2012-01-30 Thread Ted To
Hi, Is there some straightforward way to access an array by values across a subset of its dimensions? For example, if I have a three dimensional array a=(x,y,z), can I look at the values of z given particular values for x and y? Thanks, Ted ___ NumPy-D

Re: [Numpy-discussion] Conditional random variables

2011-07-05 Thread Ted To
On 07/05/2011 11:07 AM, josef.p...@gmail.com wrote: > For example sample x>=U and then sample y>=u-x. That's two univariate > normal samples. Ah, that's what I was looking for! Many thanks! ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org ht

Re: [Numpy-discussion] Conditional random variables

2011-07-05 Thread Ted To
On 07/05/2011 10:17 AM, josef.p...@gmail.com wrote: > On Mon, Jul 4, 2011 at 10:13 PM, Ted To wrote: >> Hi, >> >> Is there an easy way to make random draws from a conditional random >> variable? E.g., draw a random variable, x conditional on x>=\bar x. &

[Numpy-discussion] Conditional random variables

2011-07-04 Thread Ted To
Hi, Is there an easy way to make random draws from a conditional random variable? E.g., draw a random variable, x conditional on x>=\bar x. Thank you, Ted To ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mail