[Numpy-discussion] changing 'nan' string for np.nan in np.savetxt

2010-11-19 Thread Maria Liukis
Hello everybody, I was wondering if there is an elegant way of overwriting 'nan' string representation with 'NaN' when saving numpy array containing np.nan values with numpy.savetxt() function. numpy.set_printoptions(nanstr='NaN') setting (which has default value of 'NaN' already) does not seem

Re: [Numpy-discussion] bool indices segv

2010-06-22 Thread Maria Liukis
Hi Geoff, It's working in numpy V1.3.0: >>> import numpy >>> numpy.__version__ '1.3.0' >>> a = numpy.ones((1,1)) >>> a[a>0] array([ 1.]) >>> Thanks, Masha liu...@usc.edu On Jun 22, 2010, at 4:37 PM, Geoffrey Ely wrote: > Hi, > > I'm getting a SEGV for boolean indices

[Numpy-discussion] loadtxt raises an exception on empty file

2010-05-24 Thread Maria Liukis
Hello everybody, I'm using numpy V1.3.0 and ran into a case when numpy.loadtxt('foo.txt') raised an exception: >>>import numpy as np >>>np.loadtxt('foo.txt') Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pa

[Numpy-discussion] saving object array to ascii file

2010-05-06 Thread Maria Liukis
Hello Everybody, Sorry if it's a trivial question. I'm trying to find out if there is a way to save object array to ascii file. numpy.savetxt() in NumPy V1.3.0 doesn't seem to work: >>> import numpy as np >>> obj_arr = np.zeros((2,), dtype=np.object) >>> obj_arr[0] = np.array([[1,2,3], [4,5,6],

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
Josef, Many thanks for the example! It should become an official NumPy recipe :) Thanks again, Masha liu...@usc.edu On Aug 17, 2009, at 10:03 PM, josef.p...@gmail.com wrote: On Tue, Aug 18, 2009 at 12:59 AM, Maria Liukis wrote: On Aug 17, 2009, at 9:51 PM, Charles

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
On Aug 17, 2009, at 10:03 PM, josef.p...@gmail.com wrote: > On Tue, Aug 18, 2009 at 12:59 AM, Maria Liukis wrote: >> >> On Aug 17, 2009, at 9:51 PM, Charles R Harris wrote: >> >> >> On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis >> wrote: >>> >

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
On Aug 17, 2009, at 9:51 PM, Charles R Harris wrote: On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis wrote: Hello everybody, While re-implementing some Matlab code in Python, I've run into a problem of finding a NumPy function analogous to the Matlab's "unique(array,

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
Josef, Thanks, I'll try that and will search for your question from last december :) Masha liu...@usc.edu On Aug 17, 2009, at 9:44 PM, josef.p...@gmail.com wrote: On Tue, Aug 18, 2009 at 12:30 AM, Maria Liukis wrote: Hello everybody, While re-implementing

[Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
Hello everybody, While re-implementing some Matlab code in Python, I've run into a problem of finding a NumPy function analogous to the Matlab's "unique (array, 'rows')" to get unique rows of an array. Searching the web, I've found a similar discussion from couple of years ago with an exam

Re: [Numpy-discussion] Indexing empty array with empty boolean array causes "IndexError: invalid index exception"

2009-08-17 Thread Maria Liukis
On Aug 12, 2009, at 9:25 AM, Robert Kern wrote: > On Mon, Aug 10, 2009 at 14:19, Maria Liukis wrote: >> Hello everybody, >> I'm using following versions of Scipy and Numpy packages: >>>>> scipy.__version__ >> '0.7.1' >>>>> n

Re: [Numpy-discussion] Indexing empty array with empty boolean array causes "IndexError: invalid index exception"

2009-08-10 Thread Maria Liukis
A correction for the typo below. Thanks, Masha liu...@usc.edu On Aug 10, 2009, at 12:19 PM, Maria Liukis wrote: Hello everybody, I'm using following versions of Scipy and Numpy packages: >>> scipy.__version__ '0.7.1' >>> np.__versio

[Numpy-discussion] Indexing empty array with empty boolean array causes "IndexError: invalid index exception"

2009-08-10 Thread Maria Liukis
Hello everybody, I'm using following versions of Scipy and Numpy packages: >>> scipy.__version__ '0.7.1' >>> np.__version__ '1.3.0' My code uses boolean array to filter 2-dimensional array which sometimes happens to be an empty array. It seems like I have to take special care when dimension

Re: [Numpy-discussion] scipy.stats.poisson.ppf raises "OverflowError: cannot convert float infinity to long"

2009-08-04 Thread Maria Liukis
Josef, Thanks a bunch! Masha liu...@usc.edu On Aug 4, 2009, at 4:01 PM, josef.p...@gmail.com wrote: On Tue, Aug 4, 2009 at 6:36 PM, Maria Liukis wrote: Hello everybody, I'm using the following versions of scipy and numpy: scipy.__version__ '0.6.0' imp

[Numpy-discussion] scipy.stats.poisson.ppf raises "OverflowError: cannot convert float infinity to long"

2009-08-04 Thread Maria Liukis
Hello everybody, I'm using the following versions of scipy and numpy: >>> scipy.__version__ '0.6.0' >>> import numpy >>> numpy.__version__ '1.1.1' Would anybody happen to know why I get an exception when calling scipy.stats.poisson.ppf function: >>> from scipy.stats import * >>> poisson.ppf