[Numpy-discussion] A question about dtype syntax

2011-08-30 Thread Marquette Jean-Baptiste
Hi all, I have this piece of code: Stats = [CatBase, round(stats.mean(Data.Ra), 5), round(stats.mean(Data.Dec), 5), len(Sep), round(stats.mean(Sep),4), round(stats.stdev(Sep),4)] print Stats if First: StatsAll = np.array(np.asarray(Stats), dtype=('a11, f8, f8, i4, f8, f8'))

Re: [Numpy-discussion] A question about dtype syntax

2011-08-30 Thread Pierre GM
On Aug 30, 2011, at 10:46 AM, Marquette Jean-Baptiste wrote: Hi all, I have this piece of code: Stats = [CatBase, round(stats.mean(Data.Ra), 5), round(stats.mean(Data.Dec), 5), len(Sep), round(stats.mean(Sep),4), round(stats.stdev(Sep),4)] print Stats if First: StatsAll =

[Numpy-discussion] Want to find a scientific app using NumPy to process large set of data, say more than 1000000 elements in ndarray.

2011-08-30 Thread Qisheng Yang
Hello, All As the subject say, I want to exercise *multiprocessing *module in NumPy in order to take advantage of multi-cores. A project which processing large set of data will be useful to compare single thread with multi-thread. I have reviewed some projects using NumPy/SciPy list on SciPy

[Numpy-discussion] wierd numpy.void behavior

2011-08-30 Thread Neal Becker
I've encountered something weird about numpy.void. arr = np.empty ((len(results),), dtype=[('deltaf', float), ('quantize', [('int', int), ('frac', int)])]) for i,r in enumerate (results): arr[i] = (r[0]['deltaf'],

Re: [Numpy-discussion] wierd numpy.void behavior

2011-08-30 Thread Olivier Delalleau
It looks like numpy.void does not properly implement __hash__: In [35]: arr[0]['quantize'] == arr[1]['quantize'] Out[35]: True In [34]: hash(arr[0]['quantize']) == hash(arr[1]['quantize']) Out[34]: False I'm not familiar enough with this kind of data type to tell you if you are using it as it

[Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
Python 3.2, 64-bit Win 7 When I try to install numpy-1.6.1.win32-py3.2.exe (md5) I get Python version 3.2 required, which was not found in the registry. What to do? Thanks, Dick Moores ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Charles R Harris
On Tue, Aug 30, 2011 at 7:47 AM, Richard D. Moores rdmoo...@gmail.comwrote: Python 3.2, 64-bit Win 7 When I try to install numpy-1.6.1.win32-py3.2.exe (md5) I get Python version 3.2 required, which was not found in the registry. What to do? Did you already install python from

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
On Tue, Aug 30, 2011 at 06:53, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 7:47 AM, Richard D. Moores rdmoo...@gmail.com wrote: Python 3.2, 64-bit Win 7 When I try to install numpy-1.6.1.win32-py3.2.exe (md5) I get Python version 3.2 required, which was not

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Bruce Southey
On Tue, Aug 30, 2011 at 8:56 AM, Richard D. Moores rdmoo...@gmail.com wrote: On Tue, Aug 30, 2011 at 06:53, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 7:47 AM, Richard D. Moores rdmoo...@gmail.com wrote: Python 3.2, 64-bit Win 7 When I try to install

[Numpy-discussion] numpy oddity

2011-08-30 Thread Johann Cohen-Tanugi
I have numpy version 1.6.1 and I see the following behavior : In [380]: X Out[380]: 1.0476157527896641 In [381]: X.__class__ Out[381]: numpy.float64 In [382]: (2,3)*X Out[382]: (2, 3) In [383]: (2,3)/X Out[383]: array([ 1.90909691, 2.86364537]) In [384]: X=float(X) In [385]: (2,3)/X

Re: [Numpy-discussion] numpy oddity

2011-08-30 Thread Charles R Harris
On Tue, Aug 30, 2011 at 8:33 AM, Johann Cohen-Tanugi johann.cohentan...@gmail.com wrote: I have numpy version 1.6.1 and I see the following behavior : In [380]: X Out[380]: 1.0476157527896641 In [381]: X.__class__ Out[381]: numpy.float64 In [382]: (2,3)*X Out[382]: (2, 3) In [383]:

Re: [Numpy-discussion] numpy oddity

2011-08-30 Thread Olivier Delalleau
2011/8/30 Charles R Harris charlesr.har...@gmail.com On Tue, Aug 30, 2011 at 8:33 AM, Johann Cohen-Tanugi johann.cohentan...@gmail.com wrote: I have numpy version 1.6.1 and I see the following behavior : In [380]: X Out[380]: 1.0476157527896641 In [381]: X.__class__ Out[381]:

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
On Tue, Aug 30, 2011 at 07:19, Bruce Southey bsout...@gmail.com wrote: On Tue, Aug 30, 2011 at 8:56 AM, Richard D. Moores rdmoo...@gmail.com wrote: On Tue, Aug 30, 2011 at 06:53, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 7:47 AM, Richard D. Moores

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Olivier Delalleau
2011/8/30 Richard D. Moores rdmoo...@gmail.com Is it possible to install 32-bit Python 3.2 on 64-bit Win 7 (you seem to have done so), so I could use numpy? Yes you can insteall Python 32 bit on 64 bit Windows. -=- Olivier ___ NumPy-Discussion

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
On Tue, Aug 30, 2011 at 08:51, Olivier Delalleau sh...@keba.be wrote: 2011/8/30 Richard D. Moores rdmoo...@gmail.com Is it possible to install 32-bit Python 3.2 on 64-bit Win 7 (you seem to have done so), so I could use numpy? Yes you can insteall Python 32 bit on 64 bit Windows. Thanks.

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Charles R Harris
On Tue, Aug 30, 2011 at 10:01 AM, Richard D. Moores rdmoo...@gmail.comwrote: On Tue, Aug 30, 2011 at 08:51, Olivier Delalleau sh...@keba.be wrote: 2011/8/30 Richard D. Moores rdmoo...@gmail.com Is it possible to install 32-bit Python 3.2 on 64-bit Win 7 (you seem to have done so), so I

Re: [Numpy-discussion] load from text files Pull Request Review

2011-08-30 Thread Chris.Barker
On 8/27/11 11:08 AM, Christopher Jordan-Squire wrote: I've submitted a pull request for a new method for loading data from text files into a record array/masked record array. Click on the link for more info, but the general idea is to create a regular expression for what entries should look

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
On Tue, Aug 30, 2011 at 09:09, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 10:01 AM, Richard D. Moores rdmoo...@gmail.com wrote: On Tue, Aug 30, 2011 at 08:51, Olivier Delalleau sh...@keba.be wrote: 2011/8/30 Richard D. Moores rdmoo...@gmail.com Is it

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Charles R Harris
On Tue, Aug 30, 2011 at 10:27 AM, Richard D. Moores rdmoo...@gmail.comwrote: On Tue, Aug 30, 2011 at 09:09, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 10:01 AM, Richard D. Moores rdmoo...@gmail.com wrote: On Tue, Aug 30, 2011 at 08:51, Olivier

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
On Tue, Aug 30, 2011 at 09:43, Charles R Harris charlesr.har...@gmail.com wrote: You might want to download ipython and matplotlib also so that you have the basic numpy stack. Good idea. I got matplotlib, but ipython for Python 3x isn't on http://www.lfd.uci.edu/~gohlke/pythonlibs/ . Dick

Re: [Numpy-discussion] numpy-1.6.1.win32-py3.2.exe (md5) won't install

2011-08-30 Thread Richard D. Moores
On Tue, Aug 30, 2011 at 10:22, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 11:02 AM, Richard D. Moores rdmoo...@gmail.com wrote: On Tue, Aug 30, 2011 at 09:43, Charles R Harris charlesr.har...@gmail.com wrote: You might want to download ipython and

Re: [Numpy-discussion] numpy oddity

2011-08-30 Thread Robert Kern
On Tue, Aug 30, 2011 at 09:52, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Aug 30, 2011 at 8:33 AM, Johann Cohen-Tanugi johann.cohentan...@gmail.com wrote: I have numpy version 1.6.1 and I see the following behavior : In [380]: X Out[380]: 1.0476157527896641 In [381]:

Re: [Numpy-discussion] numpy oddity

2011-08-30 Thread Johann Cohen-Tanugi
I am not sure I follow : is the problem the coerce-sequences-to-ndarrays behavior, or is it the fact that it applies to division and not multiplication? I thought the second situation is the more problematic. Anyway, you seem to take it as a bug, should I file a ticket somewhere? thanks, johann

Re: [Numpy-discussion] numpy oddity

2011-08-30 Thread Robert Kern
On Tue, Aug 30, 2011 at 13:58, Johann Cohen-Tanugi johann.cohentan...@gmail.com wrote: I am not sure I follow : is the problem the coerce-sequences-to-ndarrays behavior, or is it the fact that it applies to division and not multiplication? I thought the second situation is the more

Re: [Numpy-discussion] numpy oddity

2011-08-30 Thread Johann Cohen-Tanugi
ok thanks a lot. Safe code is often better than over-smart code, so I would line up with Charles here. There is too much potential for ambiguity in expected behavior. Johann On 08/30/2011 09:06 PM, Robert Kern wrote: On Tue, Aug 30, 2011 at 13:58, Johann Cohen-Tanugi

[Numpy-discussion] converting standard array to record array

2011-08-30 Thread Bryce Ready
Hello all, So i'm using numpy 1.6.0, and trying to convert a (4,4) numpy array of dtype 'f8' into a record array of this dtype: dt = np.dtype([('mat','(4,4)f8')]) Here is the code snippet: In [21]: a = np.random.randn(4,4) In [22]: a.view(dt) and the resulting error: ValueError: new type

[Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Mark Janikas
Hello All, Last week I posted a question involving the identification of linear dependent columns of a matrix... but now I am finding an interesting result based on the linalg.inv() function... sometime I am able to invert a matrix that has linear dependent columns and other times I get the

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Robert Kern
On Tue, Aug 30, 2011 at 17:48, Mark Janikas mjani...@esri.com wrote: Hello All, Last week I posted a question involving the identification of linear dependent columns of a matrix… but now I am finding an interesting result based on the linalg.inv() function… sometime I am able to invert a

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Christopher Jordan-Squire
Can you give an example matrix? I'm not a numerical linear algebra expert, but I suspect that if your matrix is singular (or nearly so, in floating point) then any inverse given will look pretty wonky. Huge determinant, eigenvalues, operator norm, etc.. -Chris JS On Tue, Aug 30, 2011 at 5:48 PM,

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Mark Janikas
Working on it... Give me a few minutes to get you the data. TY! MJ -Original Message- From: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Christopher Jordan-Squire Sent: Tuesday, August 30, 2011 3:57 PM To: Discussion of Numerical Python

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Mark Janikas
When I export to ascii I am losing precision and it getting consistency... I will try a flat dump. More to come. TY MJ -Original Message- From: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Mark Janikas Sent: Tuesday, August 30, 2011 4:02

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Robert Kern
On Tue, Aug 30, 2011 at 18:34, Mark Janikas mjani...@esri.com wrote: When I export to ascii I am losing precision and it getting consistency... I will try a flat dump.  More to come.  TY Might as well np.save() it to an .npy binary file and attach it. -- Robert Kern I have come to believe

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Robert Kern
On Tue, Aug 30, 2011 at 17:48, Mark Janikas mjani...@esri.com wrote: Hello All, Last week I posted a question involving the identification of linear dependent columns of a matrix… but now I am finding an interesting result based on the linalg.inv() function… sometime I am able to invert a

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Mark Janikas
OK... so I have been using checksums to compare and it looks like I am getting a different value when it fails as opposed to when it passes... I.e. the input is NOT the same. When I save them to npy files and run LA.inv() I get consistent results. Now I have to track down in my code why the

[Numpy-discussion] Issue with dtype and nx1 arrays

2011-08-30 Thread Thomas Robitaille
Hello, Is the following behavior normal? In [1]: import numpy as np In [2]: np.dtype([('a','f4',2)]) Out[2]: dtype([('a', 'f4', (2,))]) In [3]: np.dtype([('a','f4',1)]) Out[3]: dtype([('a', 'f4')]) I.e. in the second case, the second dimension of the dtype (1) is being ignored? Is there a way

[Numpy-discussion] nan division warnings

2011-08-30 Thread mdekauwe
Hi, this is probably my lack of understanding...when i set up some masks for 2 arrays and try to divide one by the other I get a runtime warning. Seemingly this is when I am asking python to divide one nan by the other, however I thought by masking the array numpy would then know to ignore these

Re: [Numpy-discussion] Issue with dtype and nx1 arrays

2011-08-30 Thread Warren Weckesser
On Tue, Aug 30, 2011 at 10:34 PM, Thomas Robitaille thomas.robitai...@gmail.com wrote: Hello, Is the following behavior normal? In [1]: import numpy as np In [2]: np.dtype([('a','f4',2)]) Out[2]: dtype([('a', 'f4', (2,))]) In [3]: np.dtype([('a','f4',1)]) Out[3]: dtype([('a', 'f4')])

Re: [Numpy-discussion] converting standard array to record array

2011-08-30 Thread josef . pktd
On Tue, Aug 30, 2011 at 4:34 PM, Bryce Ready bryce.re...@gmail.com wrote: Hello all, So i'm using numpy 1.6.0, and trying to convert a (4,4) numpy array of dtype 'f8' into a record array of this dtype: dt = np.dtype([('mat','(4,4)f8')]) Here is the code snippet: In [21]: a =

[Numpy-discussion] Wrong treatment of byte-order.

2011-08-30 Thread Nadav Horesh
Hi, This is my second post on this problem I found in numpy 1.6.1, and recently it cam up in the latest git version (2.0.0.dev-f3e70d9). The problem is numpy treats the native byte order ('') as illegal while the wrong one ('') as the right one. The output of the attached script (bult for