Re: [Numpy-discussion] Efficient way to load a 1Gb file?

2011-08-11 Thread Chris Barker
aarrgg! I cleaned up the doc string a bit, but didn't save before sending -- here it is again, Sorry about that. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seat

Re: [Numpy-discussion] Efficient way to load a 1Gb file?

2011-08-11 Thread Chris Barker
On 8/10/2011 1:01 PM, Anne Archibald wrote: There was also some work on a semi-mutable array type that allowed appending along one axis, then 'freezing' to yield a normal numpy array (unfortunately I'm not sure how to find it in the mailing list archives). That was me, and here is the thread --

Re: [Numpy-discussion] how to create a block diagonal matrix by repeating the block?

2011-08-11 Thread Warren Weckesser
On Thu, Aug 11, 2011 at 7:15 PM, Fernando Perez wrote: > On Thu, Aug 11, 2011 at 4:43 PM, Jose Borreguero > wrote: > > a = random.randn(3,3) > > b = a.reshape(1,3,3).repeat(50,axis=0) > > scipy.linalg.block_diag( *b ) > > > > slightly simpler, but equivalent, code: > > b = [a]*50 > scipy.linalg.b

Re: [Numpy-discussion] how to create a block diagonal matrix by repeating the block?

2011-08-11 Thread Fernando Perez
On Thu, Aug 11, 2011 at 4:43 PM, Jose Borreguero wrote: > a = random.randn(3,3) > b = a.reshape(1,3,3).repeat(50,axis=0) > scipy.linalg.block_diag( *b ) > slightly simpler, but equivalent, code: b = [a]*50 scipy.linalg.block_diag( *b) Cheers, f ___ N

[Numpy-discussion] how to create a block diagonal matrix by repeating the block?

2011-08-11 Thread Jose Borreguero
Dear numpy users, I have a 3x3 matrix which I want to repeat 50 times along a diagonal, thus creating a 150x150 block diagonal matrix. I know of a method usin scipy.linalg.block_diag, but I don't know if this is the best one: a = random.randn(3,3) b = a.reshape(1,3,3).repeat(50,axis=0) scipy.lina

Re: [Numpy-discussion] bug with assignment into an indexed array?

2011-08-11 Thread Benjamin Root
On Thu, Aug 11, 2011 at 10:33 AM, Olivier Delalleau wrote: > 2011/8/11 Benjamin Root > >> >> >> On Thu, Aug 11, 2011 at 8:37 AM, Olivier Delalleau wrote: >> >>> Maybe confusing, but working as expected. >>> >>> >>> When you write: >>> matched_to[np.array([0, 1, 2])] = 3 >>> it calls __setitem

Re: [Numpy-discussion] Efficient way to load a 1Gb file?

2011-08-11 Thread Russell E. Owen
In article , Anne Archibald wrote: > There was also some work on a semi-mutable array type that allowed > appending along one axis, then 'freezing' to yield a normal numpy > array (unfortunately I'm not sure how to find it in the mailing list > archives). One could write such a setup by hand, u

[Numpy-discussion] Questionable reduceat behavior

2011-08-11 Thread Wes McKinney
I'm a little perplexed why reduceat was made to behave like this: In [26]: arr = np.ones((10, 4), dtype=bool) In [27]: arr Out[27]: array([[ True, True, True, True], [ True, True, True, True], [ True, True, True, True], [ True, True, True, True], [ True, T

[Numpy-discussion] bug with latest numpy git snapshot build with Python3

2011-08-11 Thread Dmitrey
bug in KUBUNTU 11.04, latest numpy git snapshot build with Python3 >>> import numpy Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/dist-packages/numpy/__init__.py", line 137, in from . import add_newdocs File "/usr/local/lib/python3.2/d

Re: [Numpy-discussion] bug with assignment into an indexed array?

2011-08-11 Thread Olivier Delalleau
2011/8/11 Benjamin Root > > > On Thu, Aug 11, 2011 at 8:37 AM, Olivier Delalleau wrote: > >> Maybe confusing, but working as expected. >> >> >> When you write: >> matched_to[np.array([0, 1, 2])] = 3 >> it calls __setitem__ on matched_to, with arguments (np.array([0, 1, 2]), >> 3). So numpy und

Re: [Numpy-discussion] bug with assignment into an indexed array?

2011-08-11 Thread Benjamin Root
On Thu, Aug 11, 2011 at 8:37 AM, Olivier Delalleau wrote: > Maybe confusing, but working as expected. > > > When you write: > matched_to[np.array([0, 1, 2])] = 3 > it calls __setitem__ on matched_to, with arguments (np.array([0, 1, 2]), > 3). So numpy understand you want to write 3 at these ind

Re: [Numpy-discussion] SVD does not converge on "clean" matrix

2011-08-11 Thread Nadav Horesh
Had no problem on a gentoo 64 bit machine using atlas 3.8.0 (Core I7, python 2.7.2, numpy versions1.60 and 1.6.1) Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of dhan...@telecom-paristech.fr [dhan...@tel

Re: [Numpy-discussion] bug with assignment into an indexed array?

2011-08-11 Thread Olivier Delalleau
Maybe confusing, but working as expected. When you write: matched_to[np.array([0, 1, 2])] = 3 it calls __setitem__ on matched_to, with arguments (np.array([0, 1, 2]), 3). So numpy understand you want to write 3 at these indices. When you write: matched_to[:3][match] = 3 it first calls __getitem

[Numpy-discussion] SVD does not converge on "clean" matrix

2011-08-11 Thread dhanjal
Hi all, I get an error message "numpy.linalg.linalg.LinAlgError: SVD did not converge" when calling numpy.linalg.svd on a "clean" matrix of size (1952, 895). The matrix is clean in the sense that it contains no NaN or Inf values. The corresponding npz file is available here: https://docs.google.co

[Numpy-discussion] Returning ndimage subclass instances from scipy methods?

2011-08-11 Thread Keith Hughitt
Hi all, Does anyone know if it is possible to have SciPy methods which work on/return ndarray instances return subclass instances instead? For example, I can pass in an instance of a ndarray subclass to methods in scipy.ndimage, but a normal ndarray is returned instead of a new subclass instance.