[Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread Stefano Covino
Hello everybody, I have just upgraded my Mac laptop to snow leopard. However, I can no more compile Numeric 24.2. Here is my output: [MacBook-Pro-di-Stefano:~/Pacchetti/Numeric-24.2] covino% python setup.py build running build running build_py running build_ext building 'RNG.RNG' extension

Re: [Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread Matthieu Brucher
Use Numpy instead of Numeric (no longer supported I think)? Matthieu 2009/9/1 Stefano Covino stefano_cov...@yahoo.it: Hello everybody, I have just upgraded my Mac laptop to snow leopard. However, I can no more compile Numeric 24.2. Here is my output:

[Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
Hello, I tried to load a ASCII table into a string array. Unfortunately, this table has some empty chells Here it is: http://www.ncdc.noaa.gov/oa/climate/rcsg/cdrom/ismcs/alphanum.html After having converted this into a text file I tried this: $ np.genfromtxt('alphanum_to-text.txt',

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Pierre GM
On Sep 1, 2009, at 6:08 AM, Tim Michelsen wrote: Hello, I tried to load a ASCII table into a string array. Unfortunately, this table has some empty chells Here it is: http://www.ncdc.noaa.gov/oa/climate/rcsg/cdrom/ismcs/alphanum.html After having converted this into a text file I

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
Mmh, perhaps. Thanks for the quick reply. I'll try to see what I can do. Usually, this message shows up when one of the lines you have read doesn't have the same number of columns as the others. Could we add this error to the docstring? As I suggested, It would be helpful to get the line

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Citi, Luca
I have tried $ awk -F '|' '{if(NF != 12) print NR;}' /tmp/pp.txt and besides the first 23 lines and the last 3 lines of the file, also the following have a number of '|' different from 11: 1635 2851 5538 i.e. BIKIN, BENGUERIR and TERESINA AIRPORT. But I completely agree with you, genfromtxt could

[Numpy-discussion] Question about np.savez

2009-09-01 Thread jorgesmbox-ml
Hi, I know the documentation states that np.savez saves numpy arrays, so my question relates to misusing it. Before reading the doc in detail, and after reading about pickle and other options to make data persistent, I passed np.savez a list of ndarrays. It didn't complain, but when I loaded

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
$ awk -F '|' '{if(NF != 12) print NR;}' /tmp/pp.txt and besides the first 23 lines and the last 3 lines of the file, also the following have a number of '|' different from 11: 1635 2851 5538 i.e. BIKIN, BENGUERIR and TERESINA AIRPORT. Looks lika some bash magic. I will try to translate

[Numpy-discussion] Facing the Multicore-Challenge, Heidelberg 2010

2009-09-01 Thread Chris Kees
This conference may be of interest given the many discussions at SciPy on python support for parallel programming: http://www.multicore-challenge.org___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Question about np.savez

2009-09-01 Thread Pauli Virtanen
Tue, 01 Sep 2009 12:07:36 +, jorgesmbox-ml kirjoitti: I know the documentation states that np.savez saves numpy arrays, so my question relates to misusing it. Before reading the doc in detail, and after reading about pickle and other options to make data persistent, I passed np.savez a

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Citi, Luca
import sys f = open(sys.argv[1], 'rt') for l in f: if len(l.split('|')) != 12: print(l) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Tim Michelsen
But I completely agree with you, genfromtxt could print out the line number and the actual line giving problems. Here we go: http://projects.scipy.org/numpy/ticket/1212 ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] genfromtext advice

2009-09-01 Thread Bruce Southey
On 09/01/2009 09:55 AM, Tim Michelsen wrote: But I completely agree with you, genfromtxt could print out the line number and the actual line giving problems. Here we go: http://projects.scipy.org/numpy/ticket/1212 ___ NumPy-Discussion

[Numpy-discussion] np.hist with masked values

2009-09-01 Thread Tim Michelsen
Hello, should creating a histogram with masked data be different that one cretated with unmasked data? Is np.hist tuned for work with historams? I R_project I would do: # Note: values is my dataset ### masking zeros values_mask=ifelse(values==0, NA, (values)) #

Re: [Numpy-discussion] np.hist with masked values

2009-09-01 Thread Robert Kern
On Tue, Sep 1, 2009 at 11:50, Tim Michelsentimmichel...@gmx-topmail.de wrote: Hello, should creating a histogram with masked data be different that one cretated with unmasked data? Ideally, yes. Patches are welcome. In the meantime, use the .compressed() method on the masked array to get an

[Numpy-discussion] ticket for O(n) median function?

2009-09-01 Thread Sturla Molden
I could not find any, so I'll ask if it's ok to create one. I have a patch for /numpy/lib/function_base.py that uses any 'select' function to obtain the median. I'll also submit the Cython code for quickselect. Attachment (median.py.gz) contains the suggested implementation of median. I

Re: [Numpy-discussion] ticket for O(n) median function?

2009-09-01 Thread Robert Kern
On Tue, Sep 1, 2009 at 14:01, Sturla Moldenstu...@molden.no wrote: I could not find any, so I'll ask if it's ok to create one. It's always okay to create a ticket. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: [Numpy-discussion] ticket for O(n) median function?

2009-09-01 Thread Pauli Virtanen
On 2009-09-01, Sturla Molden stu...@molden.no wrote: [clip] I could not find any, so I'll ask if it's ok to create one. I have a patch for /numpy/lib/function_base.py that uses any 'select' function to obtain the median. I'll also submit the Cython code for quickselect. I'd say that just go

Re: [Numpy-discussion] A faster median (Wirth's method)

2009-09-01 Thread Sturla Molden
Dag Sverre Seljebotn skrev: Nitpick: This will fail on large arrays. I guess numpy.npy_intp is the right type to use in this case? Yup. You are right. Thanks. Sturla ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] A faster median (Wirth's method)

2009-09-01 Thread Sturla Molden
Dag Sverre Seljebotn skrev: Nitpick: This will fail on large arrays. I guess numpy.npy_intp is the right type to use in this case? By the way, here is a more polished version, does it look ok? http://projects.scipy.org/numpy/attachment/ticket/1213/generate_qselect.py

Re: [Numpy-discussion] A faster median (Wirth's method)

2009-09-01 Thread Sturla Molden
Sturla Molden skrev: By the way, here is a more polished version, does it look ok? No it doesn't... Got to keep the GIL for the general case (sorting object arrays). Fixing that. SM ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread David Warde-Farley
On 1-Sep-09, at 4:08 AM, Stefano Covino wrote: I have just upgraded my Mac laptop to snow leopard. However, I can no more compile Numeric 24.2. Do you really need Numeric? NumPy provides all of the functionality of Numeric and then some. David ___

Re: [Numpy-discussion] Question about np.savez

2009-09-01 Thread David Warde-Farley
On 1-Sep-09, at 9:08 AM, Pauli Virtanen wrote: Tue, 01 Sep 2009 12:07:36 +, jorgesmbox-ml kirjoitti: I know the documentation states that np.savez saves numpy arrays, so my question relates to misusing it. Before reading the doc in detail, and after reading about pickle and other

Re: [Numpy-discussion] Question about np.savez

2009-09-01 Thread Jorge Scandaliaris
David Warde-Farley dwf at cs.toronto.edu writes: If you actually want to save multiple arrays, you can use savez('fname', *[a,b,c]) and they will be accessible under the names arr_0, arr_1, etc. and a list of these names is in the 'files' attribute on the NpzFile object. To retrieve your

[Numpy-discussion] numpy rev7353 w/ OS X 10.6

2009-09-01 Thread Christopher Hanley
Hi, Upgraded to Snow Leopard, left setup.py and all environment variables the same, tried latest numpy from source. This is the build error I receive: Running from numpy source directory. non-existing path in 'numpy/distutils': 'site.cfg' F2PY Version 2_7353 numpy/core/setup_common.py:81:

Re: [Numpy-discussion] numpy rev7353 w/ OS X 10.6

2009-09-01 Thread Robert Kern
On Tue, Sep 1, 2009 at 21:35, Christopher Hanleychan...@stsci.edu wrote: Hi, Upgraded to Snow Leopard, left setup.py and all environment variables the same, tried latest numpy from source.  This is the build error I receive: C compiler: cc -fno-strict-aliasing -Wno-long-double

Re: [Numpy-discussion] numpy rev7353 w/ OS X 10.6

2009-09-01 Thread Christopher Hanley
Robert Kern wrote: On Tue, Sep 1, 2009 at 21:35, Christopher Hanleychan...@stsci.edu wrote: Hi, Upgraded to Snow Leopard, left setup.py and all environment variables the same, tried latest numpy from source. This is the build error I receive: C compiler: cc

Re: [Numpy-discussion] Question about np.savez

2009-09-01 Thread David Warde-Farley
On 1-Sep-09, at 10:11 PM, Jorge Scandaliaris wrote: David Warde-Farley dwf at cs.toronto.edu writes: If you actually want to save multiple arrays, you can use savez('fname', *[a,b,c]) and they will be accessible under the names arr_0, arr_1, etc. and a list of these names is in the 'files'

Re: [Numpy-discussion] Question about np.savez

2009-09-01 Thread Robert Kern
On Tue, Sep 1, 2009 at 21:11, Jorge Scandaliarisjorgesmbox...@yahoo.es wrote: David Warde-Farley dwf at cs.toronto.edu writes: If you actually want to save multiple arrays, you can use savez('fname', *[a,b,c]) and they will be accessible under the names arr_0, arr_1, etc. and a list of these

Re: [Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread Stefano Covino
David Warde-Farley dwf at cs.toronto.edu writes: On 1-Sep-09, at 4:08 AM, Stefano Covino wrote: I have just upgraded my Mac laptop to snow leopard. However, I can no more compile Numeric 24.2. Do you really need Numeric? NumPy provides all of the functionality of Numeric and then

Re: [Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread Robert Kern
On Tue, Sep 1, 2009 at 23:37, Stefano Covinostefano_cov...@yahoo.it wrote: of course you are all right. NumPy is much better. Essentially I was just curious to understand what it is wrong given that Numeric compiled smoothly with the previous Mac OSX version. The 64-bit version of OS X

Re: [Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread Stefano Covino
The 64-bit version of OS X complies to a different UNIX standard than the 32-bit version. gettimeofday(), which is being used to seed the random number generator, is one of the affected functions. Thanks. I guessed something like this. Is there a way to constrain an old-style compilation

Re: [Numpy-discussion] snow leopard and Numeric

2009-09-01 Thread Robert Kern
On Tue, Sep 1, 2009 at 23:50, Stefano Covinostefano_cov...@yahoo.it wrote: The 64-bit version of OS X complies to a different UNIX standard than the 32-bit version. gettimeofday(), which is being used to seed the random number generator, is one of the affected functions. Thanks. I guessed

Re: [Numpy-discussion] A faster median (Wirth's method)

2009-09-01 Thread Sturla Molden
Sturla Molden skrev: http://projects.scipy.org/numpy/attachment/ticket/1213/generate_qselect.py http://projects.scipy.org/numpy/attachment/ticket/1213/quickselect.pyx My suggestion for a new median function is here: http://projects.scipy.org/numpy/attachment/ticket/1213/median.py The