Re: [Numpy-discussion] mysql - record array

2006-11-16 Thread Francesc Altet
, t1-t0, seconds fileh.close() assert y1.shape == y2.shape assert np.alltrue(y1 == y2) -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Take Surveys. Earn Cash. Influence

Re: [Numpy-discussion] array from list of lists

2006-11-13 Thread Francesc Altet
([tuple(row) for row in results], dtype=mydescriptor), import numpy; results = [['M',64.0,75.0]]*1; mydescriptor = {'names': ('gender','age','weight'), 'formats':('S1','f4', 'f4')}).repeat(3,10) Out[52]:[0.49885106086730957, 0.4325258731842041, 0.43297886848449707] HTH, -- Francesc Altet

Re: [Numpy-discussion] reading matrix from a file

2006-11-08 Thread Francesc Altet
()]) : In [66]: A=numpy.array(a).reshape(2,2); B=numpy.array(b).reshape(2,2) In [67]: A, B Out[67]: (array([[ 1., 2.], [ 3., 9.]]), array([[ 2., 3.], [ 4., 4.]])) HTH, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

Re: [Numpy-discussion] reading matrix from a file

2006-11-08 Thread Francesc Altet
], [4, 4]]) Yeah. Much, much better indeed. -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need to do more? Need to support web services, security? Get stuff done

Re: [Numpy-discussion] numarray indexing problems with Python2.5 and 64-bit platforms

2006-11-03 Thread Francesc Altet
A Dijous 02 Novembre 2006 22:26, A. M. Archibald escrigué: On 02/11/06, Francesc Altet [EMAIL PROTECTED] wrote: I see this as a major issue in numarray and poses in great danger the intended support of PyTables for numarray that we planned for some time (until end of 2007). It would be nice

[Numpy-discussion] numarray indexing problems with Python2.5 and 64-bit platforms

2006-11-02 Thread Francesc Altet
a solution for this problem anytime soon, will make this very problematic to us. Thanks, -- Francesc Altet| Be careful about using the following code -- Carabos Coop. V. | I've only proven that it works, www.carabos.com | I haven't tested it. -- Donald Knuth

Re: [Numpy-discussion] Reading records from file and sorting

2006-11-01 Thread Francesc Altet
['f1'].argsort()] Out[58]: array([(1, 1), (0, 2)], dtype=[('f0', 'i2'), ('f1', 'i4')]) HTH, -- Francesc Altet| Be careful about using the following code -- Carabos Coop. V. | I've only proven that it works, www.carabos.com | I haven't tested it. -- Donald Knuth

Re: [Numpy-discussion] Reading records from file and sorting

2006-11-01 Thread Francesc Altet
). Cheers, -- Francesc Altet| Be careful about using the following code -- Carabos Coop. V. | I've only proven that it works, www.carabos.com | I haven't tested it. -- Donald Knuth - Using Tomcat but need to do

Re: [Numpy-discussion] dtype() examples that used to work

2006-10-30 Thread Francesc Altet
of nested types and recarrays. -- Francesc Altet| Be careful about using the following code -- Carabos Coop. V. | I've only proven that it works, www.carabos.com | I haven't tested it. -- Donald Knuth - Using Tomcat

Re: [Numpy-discussion] astype() behaviour

2006-10-27 Thread Francesc Altet
. This is because 'float64' is the default type in NumPy from some months ago (before the default was 'int_') HTH, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-20 Thread Francesc Altet
]) In [51]: b Out[51]: array(2) In [52]: b += 1 In [53]: b Out[53]: array(3) In [54]: a Out[54]: array([1, 3, 3]) Cheers, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat

[Numpy-discussion] Question about boolean types comparisons

2006-10-18 Thread Francesc Altet
Perhaps raising an error saying something like boolean types cannot be compared would be nice. Not too important, but worth to notice, IMO. -- 0,0 Francesc Altet| Be careful about using the following code -- V V Carabos Coop. V. | I've only proven that it works, -Enjoy Data

Re: [Numpy-discussion] Testing numpy without doing an installation?

2006-10-17 Thread Francesc Altet
A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: On 10/13/06, Francesc Altet [EMAIL PROTECTED] wrote: Is it possible to test a numpy version directly from the source directory without having to install it? I usually do: $ python setup.py build $ python setup.py install

[Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Francesc Altet
to data in memory. However, I lack experience in buffer protocol, so suggestions for achieving this are welcome. If there is some other trivial way that I haven't devised (specially if usable from pyrex), please tell me about. TIA, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos

Re: [Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Francesc Altet
don't have to book memory for copying the data area, so I'll use it. Thanks, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need to do more? Need to support

[Numpy-discussion] Testing numpy without doing an installation?

2006-10-13 Thread Francesc Altet
to install it. Thanks, -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data - Be careful about using the following code -- I've only proven that it works, I haven't tested it. -- Donald Knuth

Re: [Numpy-discussion] Memory errors

2006-10-06 Thread Francesc Altet
]) [be sure to use parentesizes appropriately] Cheers, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's

[Numpy-discussion] PyTables passes all tests with NumPy at its core

2006-10-06 Thread Francesc Altet
:-) Cheers! -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share

Re: [Numpy-discussion] Non-writeable default for numpy.ndarray

2006-10-01 Thread Francesc Altet
El dv 29 de 09 del 2006 a les 16:27 -0600, en/na Travis Oliphant va escriure: Francesc Altet wrote: I see. Thanks for the explanation. You deserve the thanks for the great testing of less-traveled corners of NumPy. It's exactly the kind of thing needed to get NumPy ready

[Numpy-discussion] Incorrect removal of NULL char in buffers

2006-09-29 Thread Francesc Altet
], dtype='|S4') i.e. it seems like numpy is striping-off NULL chars before building the object and I don't think this is correct. Cheers, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

[Numpy-discussion] Non-writeable default for numpy.ndarray

2006-09-29 Thread Francesc Altet
+20, 8.94319890e-39, 2.e+00], dtype=float32) i.e. in an array built from ndarray, the default is that it has to be read-only? -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

Re: [Numpy-discussion] Non-writeable default for numpy.ndarray

2006-09-29 Thread Francesc Altet
' f4.flags.writeable = True f4[2] = 99 a '12345123\x00\x00\xc6B34512345' The original, *immutable* string has been mutated. This could get you into real trouble in certain situations. I see. Thanks for the explanation. -- 0,0 Francesc Altet     http://www.carabos.com

Re: [Numpy-discussion] Release candidate 2.0 will come out mid-week next week

2006-09-28 Thread Francesc Altet
that properly belongs to trunk, then it's time to create the branch, but meanwhile you can save yourself quite a few syncronization work. Anyway, it is my pleasure to help finding bugs for NumPy! -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data

[Numpy-discussion] More about data types in NumPy

2006-09-27 Thread Francesc Altet
far so good, but is the next the intended behaviour? numpy.typeDict['i4'] type 'numpy.int32' numpy.typeDict['int32'] type 'numpy.int32' numpy.typeDict['i4'] == numpy.typeDict['int32'] False -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data

[Numpy-discussion] Default values in scalar constructors

2006-09-26 Thread Francesc Altet
'exceptions.TypeError' Traceback (most recent call last) /home/faltet/python.nobackup/numpy/ipython console in module() type 'exceptions.TypeError': function takes exactly 1 argument (0 given) -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

[Numpy-discussion] Negative division and numpy scalars

2006-09-25 Thread Francesc Altet
(at least, when I'm aware of it!), but I thought it would be nice to warn other people about that. Cheers, -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data - - Take Surveys. Earn

Re: [Numpy-discussion] NumPy types -- Numeric typecodes map?

2006-09-25 Thread Francesc Altet
El dl 25 de 09 del 2006 a les 11:08 -0600, en/na Travis Oliphant va escriure: Francesc Altet wrote: Hi, Anybody know if there is a map between NumPy types and Numeric typecodes? Something like 'typecodes' for numarray: How about dtype(obj).char? This doesn't work for many types

Re: [Numpy-discussion] max argmax combo

2006-09-20 Thread Francesc Altet
Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions

Re: [Numpy-discussion] max argmax combo

2006-09-19 Thread Francesc Altet
to be only three of such functions in NumPy, namely, argmax, argmin and argsort. Adding three additional 'combos' doesn't seem a lot to my mind, but it can be just 'too much' for more common sense minds. Cheers, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy

Re: [Numpy-discussion] recarray

2006-09-18 Thread Francesc Altet
El dl 18 de 09 del 2006 a les 17:10 +0200, en/na Lionel Roubeyrie va escriure: Le lundi 18 septembre 2006 12:17, Francesc Altet a écrit : You have two problems here. The first is that you shouldn't have missign entries, or conversion from empty strings to ints (or whatever) will fail

Re: [Numpy-discussion] how to get info about internals of an array object ?

2006-09-15 Thread Francesc Altet
]) In [3]:a.data Out[3]:read-write buffer for 0x82a9970, ptr 0x821f630, size 4 at 0xb6dd3300 although I'm not sure which number is the memory address I'd say it's the last one. Cheers, -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data

Re: [Numpy-discussion] recarray

2006-09-15 Thread Francesc Altet
('i4'), and the second it's the third column from ra (so the second column from ra has been stripped out from rb). HTH, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using

Re: [Numpy-discussion] PyArray_DescrConverter - alignment / trailing unused bytes

2006-09-15 Thread Francesc Altet
], dtype='|S4') In [120]: ra['dval'] Out[120]: array([ 9.73041595e-72, 9.73041595e-72]) You can still access the empty spaces if you want (although it is nonsense): In [121]: ra['unused'] Out[121]: recarray([, ], dtype='|V4') Cheers, -- 0,0 Francesc Altet     http

Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-14 Thread Francesc Altet
represents it now, I'd say that this is a backwards step in readability. Something like 'i4' would look good for a low-level library, but not for a high-level one like NumPy, IMO. Cheers, -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data

Re: [Numpy-discussion] In-place operations

2006-09-12 Thread Francesc Altet
El dt 12 de 09 del 2006 a les 13:17 -0400, en/na Pierre Thibault va escriure: Hello again, On 9/12/06, Francesc Altet [EMAIL PROTECTED] wrote: Hello Pierre, [...] Well, in some way, there is a temporary array creation that is immediately bound to B, so in the end, the temporary

Re: [Numpy-discussion] numpy test failure: ctypes is not available

2006-09-08 Thread Francesc Altet
, install ctypes separately or feel free to ignore this. I suppose that a check has to be set up in the tests to avoid ctypes ones to be checked in case ctypes is not available. -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

Re: [Numpy-discussion] Deleting a row from a matrix

2006-08-26 Thread Francesc Altet
use of TAB in ipython console). Cheers, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need to do more? Need to support web services, security? Get stuff done

[Numpy-discussion] [RFE] Suport for version 3 of array protocol in numarray

2006-08-26 Thread Francesc Altet
Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job

Re: [Numpy-discussion] Optimizing mean(axis=0) on a 3D array

2006-08-26 Thread Francesc Altet
faster. I'd say that replacing memmove by memcpy would make .take() much faster. Regards, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need to do more? Need

[Numpy-discussion] [ANN] PyTables 1.3.3 released

2006-08-25 Thread Francesc Altet
=== Announcing PyTables 1.3.3 === I'm happy to announce a new minor release of PyTables. In this one, we have focused on improving compatibility with latest beta versions of NumPy (0.9.8, 1.0b2, 1.0b3 and higher), adding some improvements and the

[Numpy-discussion] First impressions on migrating to NumPy

2006-08-18 Thread Francesc Altet
to thanks (once more), the excellent work of the NumPy crew, and specially Travis for their first-class work. Thanks! -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat

Re: [Numpy-discussion] First impressions on migrating to NumPy

2006-08-18 Thread Francesc Altet
everything, look at online docstrings and be able to do fast timings added the cerise sur le gâteau. Luck! -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need

Re: [Numpy-discussion] Memory leak in array protocol numarray --numpy

2006-08-12 Thread Francesc Altet
) a-base = obj Py_DECREF(cobj) Thanks Travis! Hey! I checked this morning Travis' patch and seems to work well for me. I'll add yours as well later on and see... BTW, where exactly I've to add the above lines? Many thanks Travis and Todd. You are great! -- 0,0 Francesc Altet     http

[Numpy-discussion] Memory leak in array protocol numarray--numpy

2006-08-11 Thread Francesc Altet
this is a relatively important problem, because it somewhat prevents a smooth transition from numarray to NumPy. Thanks, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need

Re: [Numpy-discussion] numpy.ascontiguousarray on byteswapped data !?

2006-08-11 Thread Francesc Altet
some testing code for checking numerical types, and ended with this 'animal'. Sorry about that ;-) Cheers! -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data - - Using Tomcat but need

Re: [Numpy-discussion] Version numbers again

2006-07-27 Thread Francesc Altet
) because I tend to find it slightly less confusing. However, I think that if you choose whatever convention consistently, people will get used to it and everything will be fine. -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

Re: [Numpy-discussion] Help for Windows Python, numpy and f2py

2006-06-20 Thread Francesc Altet
trying to run f2py: Mmm, perhaps you can try with putting: [build] compiler=mingw32 in your local distutils.cfg (see http://docs.python.org/inst/config-syntax.html) HTH, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

Re: [Numpy-discussion] Recarray attributes writeable

2006-06-17 Thread Francesc Altet
the attributes and fields so that they doesn't get mixed. Implementing this shouldn't be complicated at all, but I'm afraid that I can't do this right now :-( -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data

Re: [Numpy-discussion] Array Protocol change for Python 2.6

2006-06-16 Thread Francesc Altet
this capability to represent addresses? I think this would simplify things (specially it will prevent to use ascii/pointer conversions, which are ugly to my mind). Cheers, -- 0,0 Francesc Altet     http://www.carabos.com/ V V Cárabos Coop. V.   Enjoy Data

Re: [Numpy-discussion] Back to numexpr

2006-06-13 Thread Francesc Altet
A Dimarts 13 Juny 2006 19:47, Francesc Altet va escriure: - Support for both numpy and numarray (use the flag --force-numarray in setup.py). At first glance this looks like it doesn't make things to messy, so I'm in favor of incorporating this. Yeah. I thing you are right. It's