From Marketinger at yaomail.vicp.net Wed Jul 2 02:31:08 2003 From: Marketinger at yaomail.vicp.net (Judy) Date: Wed Jul 2 02:31:08 2003 Subject: [Numpy-discussion] Marketing Expert Message-ID: E-mail Marketing is one of the most effective and inexpensive ways to promote your products and services. We offer a complete E-mail Marketing solution with quality service and the lowest prices. The result is that you will enjoy more success. 1. Targeted E-mail Addresses We can supply targeted e-mail addresses according to your requirements, which are compiled only on your order, such as region / country / field / occupation / Domain Name etc. We will customize your customer e-mail addresses. * We have millions of e-mail addresses in a wide variety of categories. 2. Targeted Mailing If you are worried about any complications or consequences with sending out targeted e-mails, or want to avoid the work of sending out targeted e-mails. We will do it for you! We will send your e-mail message to your targeted customers. * We can Bullet Proof your Web Site. We also offer a wide variety of e-mail marketing software. For more details, you can refer to our web site: http://www.biz-aiding.com Our services will help you get more business opportunities. Regards! Mrs Judy Customer Support www.biz-aiding.com E-mail Marketing, at Great Fees. ************************************************************************ Receiving this email because you registered to receive special offers from one of our partners. If you would prefer not to receive future e-mail, mail to:Contacter at yiwu.com?subject=REMOVE ************************************************************************ From gvermeul at grenoble.cnrs.fr Mon Jul 7 06:03:16 2003 From: gvermeul at grenoble.cnrs.fr (Gerard Vermeulen) Date: Mon Jul 7 06:03:16 2003 Subject: [Numpy-discussion] Announcing PyQwt-3.7 Message-ID: <20030707150111.76d80d0d.gvermeul@grenoble.cnrs.fr> PyQwt-3.7 = FAST and EASY data plotting for Python and Qt. PyQwt is a set of Python bindings for the Qwt C++ class library. Qwt extends the Qt framework with widgets for scientific and engineering applications. PyQwt really shines with Numeric and/or numarray. Numeric and numarray extend Python with new data types that make Python an ideal language for numerical computing and experimentation. PyQwt requires and extends PyQt, a set of Python bindings for Qt. PyQwt runs on Windows and Unix/Linux. The home page of PyQwt has moved to http://pyqwt.sourceforge.net. New features in PyQwt-3.7: 1. PyQwt will work with either Numeric, or numarray or both (depending on the presence of Numeric and numarray during PyQwt's build). 2. PyQwt will work without Numeric and numarray (is not recommended). 3. PyQwt is compatible with the Python Command Line Interpreter or IPython, provided that the readline module is installed: Qt's event processing is scheduled by the readline library through (int)(*PyOS_InputHook)(void). 4. PyQwt is always rlcompleter-friendly, even though PyQt-3.6 and earlier are not (the dir() function has been enhanced in PyQt-3.7). 5. The module qwt.qplt is enhanced: qwt.qplt is sugar coating for the QwtPlot widget to facilitate plotting from an interpreter. 6. QwtImagePlot maps a 2-dimensional array of z-values on a QImage using a color scale. 7. New Qwt widgets: QwtDial and QwtCompass. 8. Works with PyQt-3.7, PyQt-3.6, PyQt-3.5 and PyQt-3.4. 9. Works with Qt-2.3.x, Qt-3.0.x and Qt-3.1.x. Gerard Vermeulen From o.mekkaoui at free.fr Fri Jul 11 02:45:52 2003 From: o.mekkaoui at free.fr (o.mekkaoui) Date: Fri Jul 11 02:45:52 2003 Subject: [Numpy-discussion] linking Python, GSL and mysql Message-ID: <3F0E7DD7.4050003@free.fr> Hi, I used Numeric, GSL and mysql to create some C python extension. The objective is to make requests and after are stocked in a python array. So this work fine with python1.5 and Numeric17 using: gcc -c GnoStructTC.c -DHAVE_CONFIG_H -I/usr/include/python-I/usr/lib/python/config1.5 -I/usr/inlude/mysql -I/usr/lib/mysql gcc -shared GnoStructTC.o -lgsl -lgslcblas -lmysqlclient -o GnoStructTC.so Now, with Python 2.2 and Numeric22 : this don't work (default segmentation) and I can't create my array On other hand, if I just create simple array using gcc -c GnoStructTC.c -DHAVE_CONFIG_H -I/usr/include/python2.2 -I/usr/lib/python2.2/config gcc -shared GnoStructTC.o -o GnoStructTC.so there are no problem. Perhaps there are some mistakes in the compilation or a conflit between Numeric and GSL. Any idea. Thanks in advance. From vip2000 at yahoo.com Fri Jul 11 11:04:15 2003 From: vip2000 at yahoo.com (vip2000 at yahoo.com) Date: Fri Jul 11 11:04:15 2003 Subject: [Numpy-discussion] please get back to me !!! Message-ID: An HTML attachment was scrubbed... URL: From 238122 at mail.com Mon Jul 14 18:02:25 2003 From: 238122 at mail.com (238122 at mail.com) Date: Mon Jul 14 18:02:25 2003 Subject: [Numpy-discussion] Copy DVD's to a standard CD - without a DVD Burner 238122 Message-ID: An HTML attachment was scrubbed... URL: From jmiller at stsci.edu Tue Jul 15 12:32:23 2003 From: jmiller at stsci.edu (Todd Miller) Date: Tue Jul 15 12:32:23 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? Message-ID: <1058297679.25273.13.camel@halloween.stsci.edu> I am adding arrays of Python objects to numarray and so I am curious about the uses people have found for Numeric's object arrays. If you have found Numeric's object arrays useful, please tell us about what you used them for so that we can make certain that numarray can satisfy the same need. Thanks, Todd -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From hinsen at cnrs-orleans.fr Wed Jul 16 02:27:17 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Wed Jul 16 02:27:17 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058297679.25273.13.camel@halloween.stsci.edu> References: <1058297679.25273.13.camel@halloween.stsci.edu> Message-ID: <200307161126.11107.hinsen@cnrs-orleans.fr> On Tuesday 15 July 2003 21:34, Todd Miller wrote: > I am adding arrays of Python objects to numarray and so I am curious > about the uses people have found for Numeric's object arrays. If you > have found Numeric's object arrays useful, please tell us about what > you used them for so that we can make certain that numarray can satisfy > the same need. I have used them several times in order to be able to use array operations on number-like objects, e.g. multiple precision numbers, quaternions, automatic derivatives, polynomials, etc. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From jmiller at stsci.edu Wed Jul 16 09:30:18 2003 From: jmiller at stsci.edu (Todd Miller) Date: Wed Jul 16 09:30:18 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <200307161126.11107.hinsen@cnrs-orleans.fr> References: <1058297679.25273.13.camel@halloween.stsci.edu> <200307161126.11107.hinsen@cnrs-orleans.fr> Message-ID: <1058372983.3465.69.camel@localhost.localdomain> On Wed, 2003-07-16 at 05:26, Konrad Hinsen wrote: > On Tuesday 15 July 2003 21:34, Todd Miller wrote: > > I am adding arrays of Python objects to numarray and so I am curious > > about the uses people have found for Numeric's object arrays. If you > > have found Numeric's object arrays useful, please tell us about what > > you used them for so that we can make certain that numarray can satisfy > > the same need. > > I have used them several times in order to be able to use array operations on > number-like objects, e.g. multiple precision numbers, quaternions, automatic > derivatives, polynomials, etc. OK. Right now the prototype supports array structural operations (indexing, slicing, array indexing, copies, views, transpose...) and element-wise operator application (so when you add two object arrays, the corresponding objects are added using the number protocol). Support for universal functions (calling numarray.add(a,b) rather than a+b) and the C-API for object arrays is still missing. Did these matter to your application of object arrays? -- Todd Miller From hinsen at cnrs-orleans.fr Wed Jul 16 10:36:03 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Wed Jul 16 10:36:03 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058372983.3465.69.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <200307161126.11107.hinsen@cnrs-orleans.fr> <1058372983.3465.69.camel@localhost.localdomain> Message-ID: <200307161934.13611.hinsen@cnrs-orleans.fr> On Wednesday 16 July 2003 18:29, you wrote: > Support for universal functions (calling numarray.add(a,b) rather than > a+b) and the C-API for object arrays is still missing. Did these matter > to your application of object arrays? Not add(a, b), but add.reduce(a) as well as things like log(a). Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From jmiller at stsci.edu Wed Jul 16 10:50:36 2003 From: jmiller at stsci.edu (Todd Miller) Date: Wed Jul 16 10:50:36 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <200307161934.13611.hinsen@cnrs-orleans.fr> References: <1058297679.25273.13.camel@halloween.stsci.edu> <200307161126.11107.hinsen@cnrs-orleans.fr> <1058372983.3465.69.camel@localhost.localdomain> <200307161934.13611.hinsen@cnrs-orleans.fr> Message-ID: <1058377806.3466.98.camel@localhost.localdomain> On Wed, 2003-07-16 at 13:34, Konrad Hinsen wrote: > On Wednesday 16 July 2003 18:29, you wrote: > > > Support for universal functions (calling numarray.add(a,b) rather than > > a+b) and the C-API for object arrays is still missing. Did these matter > > to your application of object arrays? > > Not add(a, b), but add.reduce(a) as well as things like log(a). OK. That makes sense. I have a fair amount of work left to do... > Konrad. -- Todd Miller From tchur at optushome.com.au Wed Jul 16 14:46:06 2003 From: tchur at optushome.com.au (Tim Churches) Date: Wed Jul 16 14:46:06 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058297679.25273.13.camel@halloween.stsci.edu> References: <1058297679.25273.13.camel@halloween.stsci.edu> Message-ID: <1058391802.1206.31.camel@emilio> On Wed, 2003-07-16 at 05:34, Todd Miller wrote: > I am adding arrays of Python objects to numarray and so I am curious > about the uses people have found for Numeric's object arrays. If you > have found Numeric's object arrays useful, please tell us about what > you used them for so that we can make certain that numarray can satisfy > the same need. We use NumPy to store vectors (rank-1 arrays) of numbers representing columns in a dataset. The NumPy arrays, which are large and numerous) are memory-mapped (using an extension) to disc to conserve real memory. However, in some vectors (columns) we need to store variable-length, and in others, variable length sequences of integers or floats (and possibly even sets in the future). NumPy's object arrays are more memory-efficient that Python lists of lists or lists of strings from these purposes, and of course they support NumPy functions such as take(), which makes life simpler. But we haven't been able to memory-map these object arrays, which is a problem. Is there any prospect of numarray supporting memory-mapped arrays of sequences/strings? I know that is a big ask! We have an extension module which stores variable length blobs in a single memory-mapped file which might be useful - the code could be made available to the numarray project, I think. We also use MA extensively (because in the health care domain life is full of missing data) - I'll jot down some thoughts on how MA could be improved in the next few days. -- Tim C PGP/GnuPG Key 1024D/EAF993D0 available from keyservers everywhere or at http://members.optushome.com.au/tchur/pubkey.asc Key fingerprint = 8C22 BF76 33BA B3B5 1D5B EB37 7891 46A9 EAF9 93D0 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From jmiller at stsci.edu Wed Jul 16 15:37:04 2003 From: jmiller at stsci.edu (Todd Miller) Date: Wed Jul 16 15:37:04 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058391802.1206.31.camel@emilio> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> Message-ID: <1058394996.6996.40.camel@localhost.localdomain> On Wed, 2003-07-16 at 17:43, Tim Churches wrote: > On Wed, 2003-07-16 at 05:34, Todd Miller wrote: > > I am adding arrays of Python objects to numarray and so I am curious > > about the uses people have found for Numeric's object arrays. If you > > have found Numeric's object arrays useful, please tell us about what > > you used them for so that we can make certain that numarray can satisfy > > the same need. > > We use NumPy to store vectors (rank-1 arrays) of numbers representing > columns in a dataset. The NumPy arrays, which are large and numerous) > are memory-mapped (using an extension) to disc to conserve real memory. > However, in some vectors (columns) we need to store variable-length, and > in others, variable length sequences of integers or floats (and possibly > even sets in the future). NumPy's object arrays are more > memory-efficient that Python lists of lists or lists of strings from Well, right now the prototype actually uses a single list internally as the object store; still, we might beat out lists of lists by a small margin. > these purposes, and of course they support NumPy functions such as > take(), which makes life simpler. The prototype currently uses common code for put/take on strings, object arrays, and soon record arrays. The common code is currently Python prototype. Numarray numeric arrays use specialized C-code for speed. > But we haven't been able to memory-map > these object arrays, which is a problem. Is there any prospect of > numarray supporting memory-mapped arrays of sequences/strings? numarray supports arrays of fixed length strings with its chararray module. The default chararray string stripping and padding functions blank fill unused space and give the appearance of variable length strings. The data buffers of all of numarray's classes which represent primitive data items (numbers, strings, records) can be memory mapped. I think however that memory mapping sequences or arbitrary Python objects isn't going to happen in numarray any time soon; it sounds too much like object persistence. > I know > that is a big ask! We have an extension module which stores variable > length blobs in a single memory-mapped file which might be useful - the > code could be made available to the numarray project, I think. I don't understand the difference between your module and Python's mmap. > > We also use MA extensively (because in the health care domain life is > full of missing data) - I'll jot down some thoughts on how MA could be > improved in the next few days. I'd be very interested in hearing your thoughts on improving MA. -- Todd Miller From djc at object-craft.com.au Wed Jul 16 18:14:06 2003 From: djc at object-craft.com.au (Dave Cole) Date: Wed Jul 16 18:14:06 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058394996.6996.40.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> Message-ID: >>>>> "Todd" == Todd Miller writes: Todd> I think however that memory mapping sequences or arbitrary Todd> Python objects isn't going to happen in numarray any time soon; Todd> it sounds too much like object persistence. It is used to minimize the cost of huge datasets. >> I know that is a big ask! We have an extension module which stores >> variable length blobs in a single memory-mapped file which might be >> useful - the code could be made available to the numarray project, >> I think. Todd> I don't understand the difference between your module and Todd> Python's mmap. The code could use probably the Python mmap module. It would be difficult because all access to the Python mmap object is via Python. A CObject exported API in the Python mmap module would be very useful. - Dave -- http://www.object-craft.com.au From miquels at sandelman.ottawa.on.ca Thu Jul 17 01:03:01 2003 From: miquels at sandelman.ottawa.on.ca (miquels at sandelman.ottawa.on.ca) Date: Thu Jul 17 01:03:01 2003 Subject: [Numpy-discussion] new mail NaHZuBL5 In-Reply-To: References: Message-ID: English version | ??????? ??????? ?? ???? ?????????? ??? ????? ?????????? ???????? ?????? http://www.mail15.com. ??? ????????????? ???????????: 1) ?????? ????? 15 ??; 2) ???????????? ? ??????????; 3) ??????????? ????????????? ????? ???????? ????????(POP,IMAP,SMTP); 4) ?????? ?? ?????? ????? ? ????? ?????; 5) ??????? ? ????????? ???????????? ? ?????? ??????????? ???????; 6) ???????????? ? ???????????? ????????; 7) ?????????? ????????? ?????. ???? ?? ?? ?????? ???????? ????? ?????? ????????, ?????? mailto:unsubscribe at mail15.com?subject=unsubscribe ************* We are glad to invite you at new free mail service http://www.mail15.com. The advantages of this service are: 1) mailbox, up to 15 Mb; 2) absolute privacy and high reliability; 3) ability to use mail clients (POP3, IMAP4, SMTP); 4) access from anywhere, anytime; 5) flexible light-weight web interface without advertising banners; 6) antivirus and antispam control; 7) fast mail transfer; 8) high speed network channel; 9) flexible light-weight web interface; 10) wide spread ability of mail filtering and forwarding mail; 11) clock around support; If you wish to be removed: mailto:unsubscribe at mail15.com?subject=unsubscrib wRhv8A69w9 From jmiller at stsci.edu Thu Jul 17 03:30:01 2003 From: jmiller at stsci.edu (Todd Miller) Date: Thu Jul 17 03:30:01 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> Message-ID: <1058437751.3466.26.camel@localhost.localdomain> On Wed, 2003-07-16 at 21:13, Dave Cole wrote: > >>>>> "Todd" == Todd Miller writes: > > Todd> I think however that memory mapping sequences or arbitrary > Todd> Python objects isn't going to happen in numarray any time soon; > Todd> it sounds too much like object persistence. > > It is used to minimize the cost of huge datasets. That's what we use it for too... but only for primitive data types. > > >> I know that is a big ask! We have an extension module which stores > >> variable length blobs in a single memory-mapped file which might be > >> useful - the code could be made available to the numarray project, > >> I think. > > Todd> I don't understand the difference between your module and > Todd> Python's mmap. > > The code could use probably the Python mmap module. It would be > difficult because all access to the Python mmap object is via Python. > > A CObject exported API in the Python mmap module would be very useful. > What do you want to get via the CObject API? Since any mmap can be treated as a buffer, it's easy to get a pointer and size via the Python buffer API in C. Is there something else you need? > - Dave -- Todd Miller From jmiller at stsci.edu Thu Jul 17 04:12:24 2003 From: jmiller at stsci.edu (Todd Miller) Date: Thu Jul 17 04:12:24 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> <1058437751.3466.26.camel@localhost.localdomain> Message-ID: <1058440332.3463.81.camel@localhost.localdomain> On Thu, 2003-07-17 at 06:44, Dave Cole wrote: > >>>>> "Todd" == Todd Miller writes: > > Todd> I don't understand the difference between your module and > Todd> Python's mmap. > > >> The code could use probably the Python mmap module. It would be > >> difficult because all access to the Python mmap object is via > >> Python. > >> > >> A CObject exported API in the Python mmap module would be very > >> useful. > >> > > Todd> What do you want to get via the CObject API? Since any mmap can > Todd> be treated as a buffer, it's easy to get a pointer and size via > Todd> the Python buffer API in C. Is there something else you need? > > Nope. I wonder why I didn't realise that... Too stupid I suppose. I doubt that or you wouldn't be using Python... The buffer API is just a little obscure. > > - Dave -- Todd Miller From djc at object-craft.com.au Thu Jul 17 04:26:29 2003 From: djc at object-craft.com.au (Dave Cole) Date: Thu Jul 17 04:26:29 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058437751.3466.26.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> <1058437751.3466.26.camel@localhost.localdomain> Message-ID: >>>>> "Todd" == Todd Miller writes: Todd> I don't understand the difference between your module and Todd> Python's mmap. >> The code could use probably the Python mmap module. It would be >> difficult because all access to the Python mmap object is via >> Python. >> >> A CObject exported API in the Python mmap module would be very >> useful. >> Todd> What do you want to get via the CObject API? Since any mmap can Todd> be treated as a buffer, it's easy to get a pointer and size via Todd> the Python buffer API in C. Is there something else you need? Nope. I wonder why I didn't realise that... Too stupid I suppose. - Dave -- http://www.object-craft.com.au From yeahme at 163.net Fri Jul 18 08:37:09 2003 From: yeahme at 163.net (yeahme at 163.net) Date: Fri Jul 18 08:37:09 2003 Subject: [Numpy-discussion] you didn't reply my email ? why ? ??? Message-ID: An HTML attachment was scrubbed... URL: From jmiller at stsci.edu Fri Jul 18 13:43:06 2003 From: jmiller at stsci.edu (Todd Miller) Date: Fri Jul 18 13:43:06 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 Message-ID: <1058559987.970.24.camel@halloween.stsci.edu> I have just uploaded numarray-0.6 to Source Forge. http://sourceforge.net/project/showfiles.php?group_id=1369 This is the first release with numarray repackaged as a Python package. I. ENHANCEMENTS 1. Repackaging numarray has been modified from a collection of Python modules into a Python package. See Doc/Repackaging in the source distribution for more details. 2. Median Filter Function See numarray.image.combine.median for a function which computes the median pixels in a stack of images. 3. Thread Safety Work Modifications to ufunc caching and IEEE error handling enable numarray to work in multi-threaded programs. II. BUGS FIXED 733534 Broadcasts of non-array sequences fails 733535 NA_typeNoToTypeObject sometimes fails 736674 PyArray_ContiguousFromObject() fails for some scalars 737041 Build failure on Cygwin 1.3.22 (very current install). 750320 CharArray.raw() is broken 750326 building RPMS fails 754836 Missing Src/_convmodule.c during setup 756050 chararray multi-d copy fails for recarray 772519 memory.new_memory() 64-bit scanning bug III. CAUTIONS 1. Due to the distribution repackaging, numarray-0.6 will not install correctly on top of an existing numarray installation. Before installing numarray-0.6 remove your old version of numarray. -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From falted at openlc.org Sat Jul 19 01:11:20 2003 From: falted at openlc.org (Francesc Alted) Date: Sat Jul 19 01:11:20 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: <1058559987.970.24.camel@halloween.stsci.edu> References: <1058559987.970.24.camel@halloween.stsci.edu> Message-ID: <200307191009.47736.falted@openlc.org> Hi, I've detected a problem during installation. It seems like if safethread module is out of the final package: inspiron:~/PyTables/pytables-0.6$ python2.3 Python 2.3b2 (#1, Jul 7 2003, 18:07:41) [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from numarray import * Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/site-packages/numarray/__init__.py", line 1, in ? from numarrayall import * File "/usr/local/lib/python2.3/site-packages/numarray/numarrayall.py", line 2, in ? from generic import * File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 918, in ? import numarraycore as _nc File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line 1125, in ? import ufunc File "/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", line 16, in ? import safethread ImportError: No module named safethread However, I have copied it after a previous CVS version, and that seems enough: >>> from numarray import * >>> import numarray.testall as testall >>> testall.test() *** Tester.merge: 'numarray.numtest.ratioarr' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.comparr' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.dtp' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.test' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.dummy' in both testers; summing outcomes. numeric: (0, 1037) records: (0, 48) strings: (0, 168) memmap: (0, 75) -- Francesc Alted From karczma at info.unicaen.fr Sat Jul 19 02:12:09 2003 From: karczma at info.unicaen.fr (Jerzy Karczmarczuk) Date: Sat Jul 19 02:12:09 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 References: <1058559987.970.24.camel@halloween.stsci.edu> Message-ID: <3F190AE8.3060106@info.unicaen.fr> Todd Miller wrote: > I have just uploaded numarray-0.6 to Source Forge. > > http://sourceforge.net/project/showfiles.php?group_id=1369 > > This is the first release with numarray repackaged as a Python package. GREAT. And what is even more great - I see that the version adapted to Python 2.3 is there. In some private exchange I read "of course we will upgrade, but 2.3 is beta, let's wait when it stabilizes". I sincerely think that all essential goodies (and numarray is one of them) should evolve in parallel with the kernel. Personally I wouldn't touch new versions of Python without having those additional goodies, since I wouldn't know what to do with it. Just playing with Guido's tutorial, or what? Thank you. Jerzy Karczmarczuk Caen, France From jmiller at stsci.edu Sat Jul 19 03:50:14 2003 From: jmiller at stsci.edu (Todd Miller) Date: Sat Jul 19 03:50:14 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: <200307191009.47736.falted@openlc.org> References: <1058559987.970.24.camel@halloween.stsci.edu> <200307191009.47736.falted@openlc.org> Message-ID: <1058611912.3462.35.camel@localhost.localdomain> I forgot to regenerate the MANIFEST so the .tar.gz source was incomplete. It's fixed now. Todd On Sat, 2003-07-19 at 04:09, Francesc Alted wrote: > Hi, > > I've detected a problem during installation. It seems like if safethread > module is out of the final package: > > inspiron:~/PyTables/pytables-0.6$ python2.3 > Python 2.3b2 (#1, Jul 7 2003, 18:07:41) > [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from numarray import * > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site-packages/numarray/__init__.py", line 1, > in ? > from numarrayall import * > File "/usr/local/lib/python2.3/site-packages/numarray/numarrayall.py", line > 2, in ? > from generic import * > File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 918, > in ? > import numarraycore as _nc > File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line > 1125, in ? > import ufunc > File "/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", line 16, in > ? > import safethread > ImportError: No module named safethread > > However, I have copied it after a previous CVS version, and that seems enough: > > >>> from numarray import * > >>> import numarray.testall as testall > >>> testall.test() > *** Tester.merge: 'numarray.numtest.ratioarr' in both testers; summing > outcomes. > *** Tester.merge: 'numarray.numtest.comparr' in both testers; summing > outcomes. > *** Tester.merge: 'numarray.numtest' in both testers; summing outcomes. > *** Tester.merge: 'numarray.numtest.dtp' in both testers; summing outcomes. > *** Tester.merge: 'numarray.numtest.test' in both testers; summing outcomes. > *** Tester.merge: 'numarray.numtest.dummy' in both testers; summing outcomes. > numeric: (0, 1037) > records: (0, 48) > strings: (0, 168) > memmap: (0, 75) -- Todd Miller From haase at msg.ucsf.edu Sun Jul 20 13:13:08 2003 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Sun Jul 20 13:13:08 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: <1058611912.3462.35.camel@localhost.localdomain> Message-ID: Congratulations ! And thanks for the nice work -- I'm going upgrade tomorrow... And this time even the new documentation is already online ;-) [It's just somewhat sad that google still points to the 'numarray has moved!' page] Question: In an email from May-20th (actually regarding rel.0.5) Todd wrote: "However, there is a new API function which I added in response to your last post: NA_NewAllFromBuffer() which enables you to create arrays in C from existing buffer objects rather than just C arrays." The 0.6 documentation doesn't mention that function - for now I probably have to read the source, right ? BTW - We are already using a self-made version of that - allowing us to access the CCD images that get acquired from our Microspcope (mostly C++ code) as a 16-bit unsigned int numarray - in real time! --- It's just great, and people love it. Thanks, Sebastian Haase On 19 Jul 2003 06:51:53 -0400 Todd Miller wrote: >I forgot to regenerate the MANIFEST so the .tar.gz source >was >incomplete. It's fixed now. > >Todd > >On Sat, 2003-07-19 at 04:09, Francesc Alted wrote: >> Hi, >> >> I've detected a problem during installation. It seems >>like if safethread >> module is out of the final package: >> >> inspiron:~/PyTables/pytables-0.6$ python2.3 >> Python 2.3b2 (#1, Jul 7 2003, 18:07:41) >> [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 >> Type "help", "copyright", "credits" or "license" for >>more information. >> >>> from numarray import * >> Traceback (most recent call last): >> File "", line 1, in ? >> File >>"/usr/local/lib/python2.3/site-packages/numarray/__init__.py", >>line 1, >> in ? >> from numarrayall import * >> File >>"/usr/local/lib/python2.3/site-packages/numarray/numarrayall.py", >>line >> 2, in ? >> from generic import * >> File >>"/usr/local/lib/python2.3/site-packages/numarray/generic.py", >>line 918, >> in ? >> import numarraycore as _nc >> File >>"/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", >>line >> 1125, in ? >> import ufunc >> File >>"/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", >>line 16, in >> ? >> import safethread >> ImportError: No module named safethread >> >> However, I have copied it after a previous CVS version, >>and that seems enough: >> >> >>> from numarray import * >> >>> import numarray.testall as testall >> >>> testall.test() >> *** Tester.merge: 'numarray.numtest.ratioarr' in both >>testers; summing >> outcomes. >> *** Tester.merge: 'numarray.numtest.comparr' in both >>testers; summing >> outcomes. >> *** Tester.merge: 'numarray.numtest' in both testers; >>summing outcomes. >> *** Tester.merge: 'numarray.numtest.dtp' in both >>testers; summing outcomes. >> *** Tester.merge: 'numarray.numtest.test' in both >>testers; summing outcomes. >> *** Tester.merge: 'numarray.numtest.dummy' in both >>testers; summing outcomes. >> numeric: (0, 1037) >> records: (0, 48) >> strings: (0, 168) >> memmap: (0, 75) >-- >Todd Miller > > > >------------------------------------------------------- >This SF.net email is sponsored by: VM Ware >With VMware you can run multiple operating systems on a >single machine. >WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual >machines at the >same time. Free trial click here: >http://www.vmware.com/wl/offer/345/0 >_______________________________________________ >Numpy-discussion mailing list >Numpy-discussion at lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/numpy-discussion From jmiller at stsci.edu Mon Jul 21 04:00:09 2003 From: jmiller at stsci.edu (Todd Miller) Date: Mon Jul 21 04:00:09 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: References: Message-ID: <1058785119.3460.30.camel@localhost.localdomain> On Sun, 2003-07-20 at 16:12, Sebastian Haase wrote: > Congratulations ! Thanks! > And thanks for the nice work -- I'm > going upgrade tomorrow... Great. > And this time even the new documentation is already online > ;-) [It's just somewhat sad that google still points to > the 'numarray has moved!' page] > > Question: In an email from May-20th (actually regarding > rel.0.5) Todd wrote: > "However, there is a new API function which I added in > response to your > last post: NA_NewAllFromBuffer() which enables you to > create arrays in C > from existing buffer objects rather than just C arrays." > > The 0.6 documentation doesn't mention that function - for > now I probably have to read the source, right ? Yes. The signature is: PyArrayObject * NA_NewAllFromBuffer (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) Please try it out. > BTW - We are already using a self-made version of that - > allowing us to access the CCD images that get acquired > from our Microspcope (mostly C++ code) as a 16-bit > unsigned int numarray - in real time! --- It's just great, > and people love it. Excellent. That's good to hear! > Thanks, > Sebastian Haase -- Todd Miller From falted at openlc.org Thu Jul 24 00:30:01 2003 From: falted at openlc.org (Francesc Alted) Date: Thu Jul 24 00:30:01 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058394996.6996.40.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> Message-ID: <200307240928.45091.falted@openlc.org> Some time ago, talking about object arrays Todd Miller wrote: A Dijous 17 Juliol 2003 00:36, Todd Miller va escriure: > The prototype currently uses common code for put/take on strings, object > arrays, and soon record arrays. I am thinking on supporting multimensional arrays of record arrays soon in pytables. From your words, it seems that you are planning implementing this in the next release of numarray, isn't it? That would be nice. -- Francesc Alted From maurice at akst.tn.tudelft.nl Thu Jul 24 02:26:02 2003 From: maurice at akst.tn.tudelft.nl (Maurice van de Rijzen) Date: Thu Jul 24 02:26:02 2003 Subject: [Numpy-discussion] How to compute gradients or derivatives. Message-ID: <3F1FC40E.6050601@akst.tn.tudelft.nl> Dear all, I was lookogn for u numerical extension to python and was therefore glad that i ran into numpy. I did all the calculations on mataln and I want to migrate to python. Numpy and numarray pretend to have the basic functionality of matlab and therefore i expected als a function that is able to compute gradients of high-order arrays which is a basic matlab thing. I could not find something like that. I found something in SciPy but I think that this one cannot compute high-order arrays. I'm thinkin of something as in matlab e.g. say that T=f(x,y,z,p) [gx,gy] = gradientT; Is something like that possible? Thanks in advance From jsaenz at wm.lc.ehu.es Thu Jul 24 04:52:14 2003 From: jsaenz at wm.lc.ehu.es (Jon Saenz) Date: Thu Jul 24 04:52:14 2003 Subject: [Numpy-discussion] How to compute gradients or derivatives. In-Reply-To: <3F1FC40E.6050601@akst.tn.tudelft.nl> Message-ID: take a look to some parts of the code in http://www.pyclimate.org. There are some functions to compute gradients, divergence and vertical component of the rotational of scalar and vector fields. BUT... we only support regular grids in a certain ordering, which is the one most used for climate data sets. Moreover, our derivatives are computed in spherical coordinates, like the ones used in geophysical data sets. Still, you can use the code as a starting point to develop your own functions. Jon Saenz. | Tfno: +34 946012445 Depto. Fisica Aplicada II | Fax: +34 944648500 Facultad de Ciencias. \\ Universidad del Pais Vasco \\ Apdo. 644 \\ 48080 - Bilbao \\ SPAIN On Thu, 24 Jul 2003, Maurice van de Rijzen wrote: > Dear all, > > I was lookogn for u numerical extension to python and was therefore glad > that i ran into numpy. > I did all the calculations on mataln and I want to migrate to python. > Numpy and numarray pretend to have the basic functionality of matlab and > therefore i expected als a function that is able to compute gradients of > high-order arrays which is a basic matlab thing. I could not find > something like that. I found something in SciPy but I think that this > one cannot compute high-order arrays. > I'm thinkin of something as in matlab e.g. say that T=f(x,y,z,p) > > [gx,gy] = gradientT; > > Is something like that possible? > > Thanks in advance > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > From jmiller at stsci.edu Thu Jul 24 05:09:05 2003 From: jmiller at stsci.edu (Todd Miller) Date: Thu Jul 24 05:09:05 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <200307240928.45091.falted@openlc.org> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> <200307240928.45091.falted@openlc.org> Message-ID: <1059048474.22473.6.camel@halloween.stsci.edu> On Thu, 2003-07-24 at 03:28, Francesc Alted wrote: > Some time ago, talking about object arrays Todd Miller wrote: > > A Dijous 17 Juliol 2003 00:36, Todd Miller va escriure: > > The prototype currently uses common code for put/take on strings, object > > arrays, and soon record arrays. > > I am thinking on supporting multimensional arrays of record arrays soon in > pytables. From your words, it seems that you are planning implementing this > in the next release of numarray, isn't it? That would be nice. Yes. The main feature of the next release will be support for arrays of Objects, similar to Numeric's typecode='O' arrays. > > -- > Francesc Alted > > -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From travis at enthought.com Fri Jul 25 11:32:03 2003 From: travis at enthought.com (Travis N. Vaught) Date: Fri Jul 25 11:32:03 2003 Subject: [Numpy-discussion] [ANN] SciPy 03 Workshop - Scientific Computing with Python Message-ID: <007601c352da$e1d75680$0200a8c0@tvlaptop> ------------------ SciPy '03 Workshop ------------------ The SciPy '03 Workshop on Scientific Computing with Python is being held at Cal Tech again this year. Online registration is now available. After last year's success, we expect another great turnout with compelling presentations/tutorials. It is a two day workshop held September 11-12 in Pasadena, CA. More information may be found at: http://www.scipy.org/site_content/scipy03 Online registration is available at: https://www.enthought.com/scipy03 Please register early. Last minute registrants will have to suffer the indignity of a handwritten name tag. It currently looks like breakfast (bagels, etc.), lunch and supper will be provided Thursday, and breakfast and lunch will be provided Friday. Discussion about the workshop may be directed to the SciPy-user mailing list (http://www.scipy.org/site_content/MailList) to which you may post messages at scipy-user at scipy.org. Presenters: If you would like to present at the workshop, there are two formats: - Lightning Talks: Short (5-15 minute) presentations of a particular scientific problem solved with Python. - Presentations: Traditional presentation format ~45 minute talks. If you would like to present, contact Eric Jones at eric at enthought.com. For any other questions, please feel free to call or email Travis Vaught: travis at enthought.com, (512)536-1057. You can call the same number to register via phone (Business Hours CST). Links: SciPy.org community site: http://www.scipy.org Workshop Home: http://www.scipy.org/site_content/scipy03 Summary of last year's workshop: http://www.scipy.org/site_content/scipy02/scipy02summary.htm From rmgolbeck at transilvania.eu.org Sat Jul 26 05:37:02 2003 From: rmgolbeck at transilvania.eu.org (rmgolbeck at transilvania.eu.org) Date: Sat Jul 26 05:37:02 2003 Subject: [Numpy-discussion] new mail UwEuOebt In-Reply-To: References: Message-ID: ?? ???? ?????????? ??? ????? ?????????? ???????? ?????? http://www.mail15.com. ??? ????????????? ???????????: 1) ?????? ????? 15 ??; 2) ???????????? ? ??????????; 3) ??????????? ????????????? ????? ???????? ????????(POP,IMAP,SMTP); 4) ?????? ?? ?????? ????? ? ????? ?????; 5) ??????? ? ????????? ???????????? ? ?????? ??????????? ???????; 6) ???????????? ? ???????????? ????????; 7) ?????????? ????????? ?????. ???? ?? ?? ?????? ???????? ????? ?????? ????????, ?????? mailto:unsubscribe at mail15.com?subject=unsubscribe ************* We are glad to invite you at new free mail service http://www.mail15.com. The advantages of this service are: 1) mailbox, up to 15 Mb; 2) absolute privacy and high reliability; 3) ability to use mail clients (POP3, IMAP4, SMTP); 4) access from anywhere, anytime; 5) flexible light-weight web interface without advertising banners; 6) antivirus and antispam control; 7) fast mail transfer; 8) high speed network channel; 9) flexible light-weight web interface; 10) wide spread ability of mail filtering and forwarding mail; 11) clock around support; If you wish to be removed: mailto:unsubscribe at mail15.com?subject=unsubscrib R2t0vLtgLZ From nwagner at mecha.uni-stuttgart.de Mon Jul 28 06:40:14 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon Jul 28 06:40:14 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix Message-ID: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> Hi all, How can I delete a column/row from a matrix. In Matlab: >> a=rand(4,4) a = 0.9501 0.8913 0.8214 0.9218 0.2311 0.7621 0.4447 0.7382 0.6068 0.4565 0.6154 0.1763 0.4860 0.0185 0.7919 0.4057 use >> a(:,2)=[] a = 0.9501 0.8214 0.9218 0.2311 0.4447 0.7382 0.6068 0.6154 0.1763 0.4860 0.7919 0.4057 >> a(2,:)=[] a = 0.9501 0.8214 0.9218 0.6068 0.6154 0.1763 0.4860 0.7919 0.4057 >> Is there something similar in scipy, numpy or numarray ? Any suggestion ? Nils From hinsen at cnrs-orleans.fr Mon Jul 28 07:11:03 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Mon Jul 28 07:11:03 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> Message-ID: <200307281609.18652.hinsen@cnrs-orleans.fr> > How can I delete a column/row from a matrix. As an in-place operation, not at all. To get a copy of an array with some columns/rows removed, use Numeric.take. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From nwagner at mecha.uni-stuttgart.de Mon Jul 28 07:30:10 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon Jul 28 07:30:10 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> <200307281609.18652.hinsen@cnrs-orleans.fr> Message-ID: <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> Konrad Hinsen schrieb: > > > How can I delete a column/row from a matrix. > > As an in-place operation, not at all. To get a copy of an array with some > columns/rows removed, use Numeric.take. > The in-place operation of matlab is a nice feature. Is it thinkable to have this in scipy or numarray at a later date ? Nils > Konrad. > -- > ------------------------------------------------------------------------------- > Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr > Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 > Rue Charles Sadron | Fax: +33-2.38.63.15.17 > 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ > France | Nederlands/Francais > ------------------------------------------------------------------------------- > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion From perry at stsci.edu Mon Jul 28 07:35:10 2003 From: perry at stsci.edu (Perry Greenfield) Date: Mon Jul 28 07:35:10 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> Message-ID: > > Konrad Hinsen schrieb: > > > > > How can I delete a column/row from a matrix. > > > > As an in-place operation, not at all. To get a copy of an array > with some > > columns/rows removed, use Numeric.take. > > > The in-place operation of matlab is a nice feature. Is it thinkable to > have this > in scipy or numarray at a later date ? > > Nils > Speaking for numarray, no, not really. But I wonder what is really done for matlab. Either they have a more complex representation of arrays, or all they really are doing is making a new copy of the array and giving you the impression it is being done in place. After all you are changing the size and structure of the array. Perry From hinsen at cnrs-orleans.fr Mon Jul 28 07:42:11 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Mon Jul 28 07:42:11 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> <200307281609.18652.hinsen@cnrs-orleans.fr> <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> Message-ID: <200307281640.34643.hinsen@cnrs-orleans.fr> On Monday 28 July 2003 16:26, Nils Wagner wrote: > Konrad Hinsen schrieb: > > > How can I delete a column/row from a matrix. > > > > As an in-place operation, not at all. To get a copy of an array with some > > columns/rows removed, use Numeric.take. > > The in-place operation of matlab is a nice feature. Is it thinkable to > have this > in scipy or numarray at a later date ? I'd say that the obvious way to implement it is as del a[2:3,:] That can certainly be done, but someone has to do it. Personally, I am not convinced that it is very useful. The consequences of an in-place change can be disastrous when many references point to that array. But then, we have other in-place operations which sometimes are handy, so my usefulness estimation may be wrong. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From juenglin at informatik.uni-freiburg.de Mon Jul 28 08:11:06 2003 From: juenglin at informatik.uni-freiburg.de (Ralf Juengling) Date: Mon Jul 28 08:11:06 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: References: Message-ID: <1059404954.4091.4.camel@alpspitze.cse.ogi.edu> On Mon, 2003-07-28 at 07:34, Perry Greenfield wrote: > Speaking for numarray, no, not really. But I wonder what is > really done for matlab. Either they have a more complex representation > of arrays, or all they really are doing is making a new copy of > the array and giving you the impression it is being done in place. Right, this is how Matlab does it behind the scenes. Ralf From nwagner at mecha.uni-stuttgart.de Mon Jul 28 08:23:08 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon Jul 28 08:23:08 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> <200307281609.18652.hinsen@cnrs-orleans.fr> <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> <200307281640.34643.hinsen@cnrs-orleans.fr> Message-ID: <3F253F02.F953C6D6@mecha.uni-stuttgart.de> Konrad Hinsen schrieb: > > On Monday 28 July 2003 16:26, Nils Wagner wrote: > > Konrad Hinsen schrieb: > > > > How can I delete a column/row from a matrix. > > > > > > As an in-place operation, not at all. To get a copy of an array with some > > > columns/rows removed, use Numeric.take. > > > > The in-place operation of matlab is a nice feature. Is it thinkable to > > have this > > in scipy or numarray at a later date ? > > I'd say that the obvious way to implement it is as > > del a[2:3,:] > > That can certainly be done, but someone has to do it. > > Personally, I am not convinced that it is very useful. The consequences of an > in-place change can be disastrous when many references point to that array. > But then, we have other in-place operations which sometimes are handy, so my > usefulness estimation may be wrong. > > Konrad. In my opinion, this operation is quite useful. For example a finite element model where we have to impose several homogeneous boundary conditions. This can be done by deleting columns and associated rows. Nils In any case I am interested in a reliable workaround for this feature. A small example would be appreciated. Thanks in advance. > -- > ------------------------------------------------------------------------------- > Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr > Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 > Rue Charles Sadron | Fax: +33-2.38.63.15.17 > 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ > France | Nederlands/Francais > ------------------------------------------------------------------------------- > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion From haase at msg.ucsf.edu Mon Jul 28 14:03:04 2003 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Mon Jul 28 14:03:04 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 References: <1058785119.3460.30.camel@localhost.localdomain> Message-ID: <015501c3554b$827f39f0$421ee6a9@rodan> > > "However, there is a new API function which I added in > > response to your > > last post: NA_NewAllFromBuffer() which enables you to > > create arrays in C > > from existing buffer objects rather than just C arrays." > > > > The 0.6 documentation doesn't mention that function - for > > now I probably have to read the source, right ? > > Yes. The signature is: > > PyArrayObject * NA_NewAllFromBuffer (int ndim, maybelong *shape, > NumarrayType type, PyObject *bufferObject, maybelong byteoffset, > maybelong bytestride, int byteorder, int aligned, int writeable) > Seems to work right away. But now I get this: >>> r = na.array( [ 2,3,4,5] , type=F.na.Float32 ) >>> r array([ 2., 3., 4., 5.], type=Float32) >>> r/10 Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for /: 'NumArray' and 'int' >>> r/10. Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for /: 'NumArray' and 'float' >>> Sorry to frighten you... :-( I am just experimenting with from __future__ import division Apparently taking that line out again fixes the problem. I am actually not sure what the "proposed policy" is on that future division thing; I just thought I could simplify some explanation to non-Python people if 1/3 is not 0. Probably numarray has more important things to worry about - but maybe you can put it on the list.. Thanks for your work. Sebastian From jmiller at stsci.edu Mon Jul 28 14:14:10 2003 From: jmiller at stsci.edu (Todd Miller) Date: Mon Jul 28 14:14:10 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 References: <1058785119.3460.30.camel@localhost.localdomain> <015501c3554b$827f39f0$421ee6a9@rodan> Message-ID: <001001c3554d$1ac0c6b0$e4eda782@stsci.edu> ----- Original Message ----- From: "Sebastian Haase" To: "Todd Miller" Cc: "numpy-discussion" Sent: Monday, July 28, 2003 5:02 PM Subject: Re: [Numpy-discussion] ANNOUNCE: numarray-0.6 > Seems to work right away. > But now I get this: > >>> r = na.array( [ 2,3,4,5] , type=F.na.Float32 ) > >>> r > array([ 2., 3., 4., 5.], type=Float32) > >>> r/10 > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsupported operand type(s) for /: 'NumArray' and 'int' > >>> r/10. > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsupported operand type(s) for /: 'NumArray' and 'float' > >>> > > Sorry to frighten you... :-( > I am just experimenting with > from __future__ import division > We have't added support for future division yet. > Apparently taking that line out again fixes the problem. Good. > I am actually not sure what the "proposed policy" is on that future division > thing; I just thought I could simplify some explanation to non-Python people > if 1/3 is not 0. I believe we're going to support future division eventually. I'm not sure how soon. > Probably numarray has more important things to worry about - but maybe you > can put it on the list.. It's on "the list". > Thanks for your work. You're welcome. I hope you find it useful. > Sebastian > From Boostings at freemail.soim.com Tue Jul 29 01:28:13 2003 From: Boostings at freemail.soim.com (Laura) Date: Tue Jul 29 01:28:13 2003 Subject: [Numpy-discussion] Grow Your Customers Message-ID: E-mail Marketing is one of the most effective and inexpensive ways to promote your products and services. We offer a complete E-mail Marketing solution with quality service and the lowest prices. The result is that you will enjoy more success. 1. Targeted E-mail Addresses We can supply targeted e-mail addresses according to your requirements, which are compiled only on your order, such as region / country / field / occupation / Domain Name etc. We will customize your customer e-mail addresses. * We have millions of e-mail addresses in a wide variety of categories. 2. Targeted Mailing If you are worried about any complications or consequences with sending out targeted e-mails, or want to avoid the work of sending out targeted e-mails. We will do it for you! We can send your e-mail message to your targeted customers. * We can Bullet-Proof your Web Site. We also offer a wide variety of e-mail marketing software. For more details, you can refer to our web site: http://www.aid-biz.com Our services will help you get more business opportunities. Regards! Ms Laura www.aid-biz.com Customer Support E-mail Marketing, at Great Fees. ************************************************************************ Receiving this email because you registered to receive special offers from one of our partners. If you would prefer not to receive future e-mail, Click here: Booster at ywzc.net?subject=REMOVE ************************************************************************ From jdhunter at ace.bsd.uchicago.edu Tue Jul 29 09:33:02 2003 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue Jul 29 09:33:02 2003 Subject: [Numpy-discussion] assigning to submatrix Message-ID: If I have a large matrix, say a = zeros( (20,20) ) and a small matrix b = ones( 3,4 ) and a list of row indices and a list of col indices rind = [2,4,9,15] cind = [1,4,12] what is the best way to assign the submatrix to a[rind,cind]. I understand this is possible in numarray, but is there a good way to do it in Numeric? In matlab, you could do a(rind, cind)=b; Is there some reshape, put magic I can do to make this efficient in Numeric? Thanks, John Hunter From perry at stsci.edu Tue Jul 29 10:49:10 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 10:49:10 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > -----Original Message----- > From: numpy-discussion-admin at lists.sourceforge.net > [mailto:numpy-discussion-admin at lists.sourceforge.net]On Behalf Of John > Hunter > Sent: Tuesday, July 29, 2003 12:30 PM > To: Numerical Python Discussion > Subject: [Numpy-discussion] assigning to submatrix > > > > If I have a large matrix, say > > a = zeros( (20,20) ) > > and a small matrix > > b = ones( 3,4 ) > > and a list of row indices and a list of col indices > > rind = [2,4,9,15] > cind = [1,4,12] > > what is the best way to assign the submatrix to a[rind,cind]. I > understand this is possible in numarray, but is there a good way to do > it in Numeric? > > In matlab, you could do a(rind, cind)=b; Is there some reshape, put > magic I can do to make this efficient in Numeric? > > Thanks, > John Hunter > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072 > 303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > From perry at stsci.edu Tue Jul 29 11:00:04 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 11:00:04 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > If I have a large matrix, say > > a = zeros( (20,20) ) > > and a small matrix > > b = ones( 3,4 ) > > and a list of row indices and a list of col indices > > rind = [2,4,9,15] > cind = [1,4,12] > > what is the best way to assign the submatrix to a[rind,cind]. I > understand this is possible in numarray, but is there a good way to do > it in Numeric? > > In matlab, you could do a(rind, cind)=b; Is there some reshape, put > magic I can do to make this efficient in Numeric? > > Thanks, > John Hunter Note that numarray doesn't do the same thing as matlab in this regard. In particular, the expression a[rind, cind] = b would fail since it is expecting an array on the right hand side that is the same shape as the index arrays. The assignment here is taken to mean: a[rind[0], cind[0]] = b[0] a[rind[1], cind[1]] = b[1] etc. not: a[rind[0], cind[0]] = b[0,0] etc. To do what you want doesn't currently have any atomic operation in numarray. Is this widely used? At the moment I think you would be forced to iterate over one dimension. E.g., for i in range(len(rind)): a[cind, rind[i]] = b[:, i] [Note that I reordered the index arrays to match b; I wasn't sure what was intended] There may be some clever way to avoid the explicit looping. Nothing prevents the addition of such a feature to numarray (other than work!), but it would likely have to use a function. I think the current defintion of how multiple index puts and takes work with brackets is more useful than the interpretation you are using and isn't likely to change. Perry From perry at stsci.edu Tue Jul 29 11:25:03 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 11:25:03 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix Message-ID: Nils Wagner writes: > > In any case I am interested in a reliable workaround for this feature. > > A small example would be appreciated. > Thanks in advance. > Numarray (and Numeric to a certain extent) currently is centered around what rows or columns you want rather than those you don't. Writing a reasonably efficient function to do this in a more convenient way is not hard. Here is an example for numarray (not tested, nor does it have any error checking to ensure the input array has sufficient dimensions or that the index is within the array bounds): def remove(arr, index, dim=0): """Remove subarray at index and dimension specified""" # make selected dimension the first one swparr = swapaxes(arr, 0, dim) indices = range(swparr.shape[0]) del indices[index] newarray = swparr[indices] # reorder axes as they originally appeared. return swapaxes(newarray, 0, dim) Then you can say x = remove(x, 5) to remove the 6th row or x = remove(x, 4, dim=1) to remove the 5th column. (depending on what you call rows or columns; in the examples I'm taking an image-oriented view rather than a matrix-oriented view) Perry From jmiller at stsci.edu Tue Jul 29 11:39:05 2003 From: jmiller at stsci.edu (Todd Miller) Date: Tue Jul 29 11:39:05 2003 Subject: [Numpy-discussion] Mac problem with numarray-0.6; use numarray-0.6.1 source Message-ID: <1059502562.2322.54.camel@halloween.stsci.edu> I discovered today (some bug reports have hinted at this but didn't spell it out completely) that I forgot Mac OS 10 testing for numarray-0.6. As it turns out, the numarray examples and add-ons don't compile correctly due to a small untested change. I corrected the problem and uploaded a new tarball to Source Forge: http://osdn.dl.sourceforge.net/sourceforge/numpy/numarray-0.6.1.tar.gz Non-Mac users of numarray-0.6 should just ignore numarray-0.6.1. This is a source update only. Todd -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From wagner.nils at vdi.de Tue Jul 29 12:07:03 2003 From: wagner.nils at vdi.de (Nils Wagner) Date: Tue Jul 29 12:07:03 2003 Subject: [SciPy-user] RE: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: Message-ID: ------------------- Nils Wagner writes: > > In any case I am interested in a reliable workaround for this feature. > > A small example would be appreciated. > Thanks in advance. > Numarray (and Numeric to a certain extent) currently is centered around what rows or columns you want rather than those you don't. Writing a reasonably efficient function to do this in a more convenient way is not hard. Here is an example for numarray (not tested, nor does it have any error checking to ensure the input array has sufficient dimensions or that the index is within the array bounds): def remove(arr, index, dim=0): """Remove subarray at index and dimension specified""" # make selected dimension the first one swparr = swapaxes(arr, 0, dim) indices = range(swparr.shape[0]) del indices[index] newarray = swparr[indices] # reorder axes as they originally appeared. return swapaxes(newarray, 0, dim) Then you can say x = remove(x, 5) to remove the 6th row or x = remove(x, 4, dim=1) to remove the 5th column. (depending on what you call rows or columns; in the examples I'm taking an image-oriented view rather than a matrix-oriented view) Perry Perry, Thank you for your reply. Unfortunately, I am not familiar with numarray. This is the output of my test program. from scipy import * from RandomArray import * from numarray import * def remove(arr, index, dim=0): """Remove subarray at index and dimension specified""" # make selected dimension the first one swparr = swapaxes(arr, 0, dim) indices = range(swparr.shape[0]) del indices[index] newarray = swparr[indices] # reorder axes as they originally appeared. return swapaxes(newarray, 0, dim) #Then you can say a = rand(5,5) print a a = remove(a, 2) print a #to remove the 3th row or #to remove the 3th column a = remove(a, 2, dim=1) print a [[ 0.87329948 0.81829292 0.72929943 0.13012239 0.49291104] [ 0.58665377 0.78030288 0.85906255 0.11409029 0.77719343] [ 0.01325159 0.03389675 0.25417367 0.51117259 0.61979091] [ 0.32406124 0.24500449 0.06147733 0.04323368 0.64497042] [ 0.10133368 0.25028452 0.33645368 0.34395722 0.34052679]] Traceback (most recent call last): File "nils.py", line 19, in ? a = remove(a, 2) File "nils.py", line 8, in remove swparr = swapaxes(arr, 0, dim) File "/usr/lib/python2.2/site-packages/numarray/generic.py", line 855, in swapaxes v = _nc.inputarray(array).view() File "/usr/lib/python2.2/site-packages/numarray/numarraycore.py", line 310, in inputarray return array(seq, type=type, typecode=typecode, copy=0) File "/usr/lib/python2.2/site-packages/numarray/numarraycore.py", line 303, in array raise ValueError("Unknown input type") ValueError: Unknown input type Any idea ? Nils _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From perry at stsci.edu Tue Jul 29 12:25:02 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 12:25:02 2003 Subject: [SciPy-user] RE: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: Message-ID: > from scipy import * > from RandomArray import * > from numarray import * > I believe the problem is in this part. You are getting some functions (like rand) which return a numeric array which some numarray functions don't recognize (we will be fixing this soon, they should accept any Python sequence that fits the basic requirements). For the moment you will need to generate a numarray array for that function to work. In the latest release you would do the imports as follows (for version 0.6 and later) from numarray.numeric import * from numarray.random_array import * a = random((5,5)) and so forth Perry From jdhunter at ace.bsd.uchicago.edu Tue Jul 29 12:58:03 2003 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue Jul 29 12:58:03 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: ("Perry Greenfield"'s message of "Tue, 29 Jul 2003 13:46:57 -0400") References: Message-ID: >>>>> "Perry" == Perry Greenfield writes: Perry> [Note that I reordered the index arrays to match b; I Perry> wasn't sure what was intended] Yep, I think that was a blooper on my part; to be precise, here is the matlab code a = zeros( 8,8 ); b = ones( 3,4 ); rind = [2,4,6]; cind = [1,4,5,6]; a(rind, cind) = b; and the equivalent python from Numeric import * a = zeros( (8,8) ) b = ones( (3,4) ) rind = [1,3,5] cind = [0,3,4,5] for ia, ib in zip(rind, range(len(rind))): for ja, jb in zip(cind, range(len(cind))): a[ia,ja] = b[ib,jb] print a And the question is: is there a good way to avoid the double loop using Numeric? Thanks, John From perry at stsci.edu Tue Jul 29 13:24:10 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 13:24:10 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > for ia, ib in zip(rind, range(len(rind))): > for ja, jb in zip(cind, range(len(cind))): > a[ia,ja] = b[ib,jb] > print a > > And the question is: is there a good way to avoid the double loop > using Numeric? > > Thanks, > John > At least one way, but it isn't particularly convenient or pretty (though the ugly details could be hidden in a function). (and I warn you, I haven't tested this, but something like this ought to work) # produce all possible combinations of rind and cind as # indices into an equivalent flattened for a indices = add.outer(rind*a.shape[1],cind).flat put(a, indices, b.flat) One can do this for numarray as well in a bit more straightforward way (depending on your view) [again, untested] t = ones(b.shape) a[multiply.outer(rind,t[0]),cind*t] = b In other words, this constructs two index arrays, one for each dimension, each with the same shape as the source array, b where the locations in that array correspond to the desired index in the source array. For numeric, you must do all the selection on a 1-d array, hence the index arithmetic. Perry From perry at stsci.edu Tue Jul 29 13:25:02 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 13:25:02 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > # produce all possible combinations of rind and cind as > # indices into an equivalent flattened for a > indices = add.outer(rind*a.shape[1],cind).flat > put(a, indices, b.flat) > Whoops! I suppose that should be: put(a.flat, indices, b.flat) From aleaxit at yahoo.com Thu Jul 31 09:08:02 2003 From: aleaxit at yahoo.com (Alex Martelli) Date: Thu Jul 31 09:08:02 2003 Subject: [Numpy-discussion] buglet in interaction between pygame, Numeric & copy in Python 2.3 Message-ID: <200307311806.12701.aleaxit@yahoo.com> I'm sending this buglet-report to the discussion lists for each of pygame, Numeric, and Python-Dev, because it ends with a recommendation for changes (at least to docs) in each of the two extension packages and Python 2.3.1. I'm not a regular user of pygame [I am one of Numeric]. I helped some pygame users find out why their program was breaking (in just one point) when migrating Python 2.2 -> 2.3 (Numeric 23.0, pygame 1.5.6 from cvs snapshot). The problem can be narrowed down the following little buglet.py script: import copy, pygame.display, pygame.surfarray screen = pygame.display.set_mode((640,480),0,24) surf = pygame.surfarray.pixels3d(screen) xx = copy.copy(surf[10:20,30]) With python 2.2, this runs without errors. With 2.3: Traceback (most recent call last): File "buglet.py", line 6, in ? xx = copy.copy(surf[10:20,30]) File "/usr/local/lib/python2.3/copy.py", line 101, in copy raise Error("un(shallow)copyable object of type %s" % cls) copy.Error: un(shallow)copyable object of type Workaround for the problem: add an "import Numeric" at the top of buglet.py. Reason for the problem: copy.copy uses different mechanisms in 2.3 vs 2.2 for shallow copies of Numeric.array instances. In 2.2, it looked for a method __copy__ on the instance, found it, and happily used it. In 2.3, it relies on getting a 'reductor' function from the copy_reg.dispatch_table. Module Numeric installs such a reductor *WHEN IMPORTED* -- but pygame never imports it even though functions such as the above-used pixels3d do return instances of Numeric.array. So, Numeric.py doesn't run, and therefore cannot install its pickle_array function with the copy_reg module. Suggested fix in pygame: I would suggest making sure Numeric has been imported when Numeric.array instances are to be returned. That's up to the pygame maintainers, of course; at the very least, I think this issue should be mentioned in pygame's docs (asking the user to make sure "import Numeric" happens in any pygame-using program that manipulates such instances). Suggested fix in Numeric: Numeric cannot DO anything much about this issue, I think, but it should probably *mention* (in the docs regarding interfacing to Numeric from other C-coded extensions) that other extensions should make sure Numeric is _imported_ (from a Python POV), if said extensions return instances of Numeric.array, to ensure such instances have full functionality (and in particular shallow copyability). Suggested fix in Python: a mention in the "what's new" document, section "porting to Python 2.3", is probably warranted -- not so much about Numeric and/or pygame extensions per se, though these are both popular 3rd party extensions, but rather the excellent changes in the shallow copy mechanics, which may indeed require code changes on the part of extension authors. Thanks, Alex From falted at openlc.org Thu Jul 31 15:55:11 2003 From: falted at openlc.org (Francesc Alted) Date: Thu Jul 31 15:55:11 2003 Subject: [Numpy-discussion] ANN: PyTables 0.7 Message-ID: <200308010054.21757.falted@openlc.org> Announcing PyTables 0.7 ----------------------- PyTables is a hierarchical database package designed to efficently manage very large amounts of data. PyTables is built on top of the HDF5 library and the numarray package and features an object-oriented interface that, combined with C-code generated from Pyrex sources, makes it a fast, yet extremely easy to use tool for interactively save and retrieve large amounts of data. Release 0.7 is the third public beta release. The version 0.6 was internal and will never be released. On this release you will find: - new AttributeSet class - 25% I/O speed improvement - fully multidimensional table cells support - new column descriptors - row deletion in tables is finally here - much more! More in detail: What's new ----------- - A new AttributeSet class has been added. This will allow the addition and deletion of generic attributes (any scalar type plus any Python object supported by Pickle) as easy as this: table.attrs.date = "2003/07/28 10:32" # Attach a string to table group._v_attrs.tempShift = 1.2 # Attach a float to group array.attrs.detectorList = [1,2,3,4] # Attach a list to array del array.attrs.detectorList # Detach detectorList attr from array - PyTables now has support for fully multidimensional table cells. This has been made possible in part by implementation of multidimensional cells in numarray.records.RecArray object. Thanks to numarray crew, and especially to Jin-chung Hsu, for willingly accepting to do that, and also for including some cache improvements in RecArray. - New column descriptors added: IntCol, Int8Col, UInt8Col, Int16Col, UInt16Col, Int32Col, UInt32Col, Int64Col, UInt64Col, FloatCol, Float32Col, Float64Col and StringCol. I think they are more explicit and easy-to-use than the now deprecated (but still supported) Col() descriptor. All the examples and user's manual has been accordingly updated. - The new Table.removeRows(start, stop) function allows you to remove rows from tables. This feature was requested a long time ago. There are still limitations, however: you cannot delete rows in extremely large Tables (as the remaining rows after the stop parameter are stored in memory). Nor is the performance optimized. These issues will hopefully be addressed in future releases. - Added iterators to File, Group and Table (they now support the special __iter__() method). They make the object much more user-friendly, especially in interactive mode. See documentation for usage examples. - Added a __getitem__() method to Table that works more or less like read(), but with extended slices support. - As a consequence of rewriting table iterators in C (with the help of Pyrex, of course) the table read performance has been improved between 20% and 30%. Data selections in PyTables are now starting to beat powerful relational databases like SQLite, even compared to in-core selects (!). I think there is still room for another 20% or 30% speed improvement, so stay tuned. - A checksum is now added automatically when using LZO (not with UCL where I'm having some difficulties implementing that capability). The Adler32 algorithm has been chosen because of its speed. With that, the compressing/decompressing speed has dropped 1% or 2%, which is hardly noticeable. I think this addition will allow the cautious user to be a bit more confident about this excellent compressor. Code has been added to be able to read files created without this checksum (so you can be confident that you will be able to read your existing files compressed with LZO and UCL). - Recursion has been removed from PyTables. Before, this made the maximum depth tree to be less than the Python recursion limit (which depends on implementation, but is around 900, at least in Linux). Now, the limit has been set (somewhat arbitrarily) at 2048. Thanks to John Nielsen for implementing the new iterative method!. - A new rootUEP parameter to openFile() has been added. You can now define the root from which you want to start to build the object tree. Thanks to John Nielsen for the suggestion and a first implementation. - A small bug fixed when dealing with non-native PyTables files that prevented the use of the "classname" filter during a listNodes() call. Thanks to Jeff Robbins for reporting that. - Some (non-serious) bugs were discovered and fixed. - Updated documentation to explain all these new bells and whistles. It is also available on the web: http://pytables.sourceforge.net/html-doc/usersguide-html.html - Added more unit tests (more than 350 now!) - PyTables 0.7 *needs* numarray 0.6 or higher and HDF-1.6.0 or higher to compile and work. It has been tested with Python 2.2 and 2.3 and should work fine on both versions. What is a table? ---------------- A table is defined as a collection of records whose values are stored in fixed-length fields. All records have the same structure and all values in each field have the same data type. The terms "fixed-length" and "strict data types" seems to be quite a strange requirement for an language like Python, that supports dynamic data types, but they serve a useful function if the goal is to save very large quantities of data (such as is generated by many scientific applications, for example) in an efficient manner that reduces demand on CPU time and I/O resources. What is HDF5? ------------- For those people who know nothing about HDF5, it is is a general purpose library and file format for storing scientific data made at NCSA. HDF5 can store two primary objects: datasets and groups. A dataset is essentially a multidimensional array of data elements, and a group is a structure for organizing objects in an HDF5 file. Using these two basic constructs, one can create and store almost any kind of scientific data structure, such as images, arrays of vectors, and structured and unstructured grids. You can also mix and match them in HDF5 files according to your needs. Platforms --------- I'm using Linux as the main development platform, but PyTables should be easy to compile/install on other UNIX machines. This package has also passed all the tests on a UltraSparc platform with Solaris 7 and Solaris 8. It also compiles and passes all the tests on a SGI Origin2000 with MIPS R12000 processors and running IRIX 6.5. Regarding Windows platforms, PyTables has been tested with Windows 2000 and Windows XP, but it should also work with other flavors. An example? ----------- For online code examples, have a look at http://pytables.sourceforge.net/tut/tutorial1-1.html and http://pytables.sourceforge.net/tut/tutorial1-2.html Web site -------- Go to the PyTables web site for more details: http://pytables.sourceforge.net/ Share your experience --------------------- Let me know of any bugs, suggestions, gripes, kudos, etc. you may have. Have fun! -- Francesc Alted falted at openlc.org From Marketinger at yaomail.vicp.net Wed Jul 2 02:31:08 2003 From: Marketinger at yaomail.vicp.net (Judy) Date: Wed Jul 2 02:31:08 2003 Subject: [Numpy-discussion] Marketing Expert Message-ID: E-mail Marketing is one of the most effective and inexpensive ways to promote your products and services. We offer a complete E-mail Marketing solution with quality service and the lowest prices. The result is that you will enjoy more success. 1. Targeted E-mail Addresses We can supply targeted e-mail addresses according to your requirements, which are compiled only on your order, such as region / country / field / occupation / Domain Name etc. We will customize your customer e-mail addresses. * We have millions of e-mail addresses in a wide variety of categories. 2. Targeted Mailing If you are worried about any complications or consequences with sending out targeted e-mails, or want to avoid the work of sending out targeted e-mails. We will do it for you! We will send your e-mail message to your targeted customers. * We can Bullet Proof your Web Site. We also offer a wide variety of e-mail marketing software. For more details, you can refer to our web site: http://www.biz-aiding.com Our services will help you get more business opportunities. Regards! Mrs Judy Customer Support www.biz-aiding.com E-mail Marketing, at Great Fees. ************************************************************************ Receiving this email because you registered to receive special offers from one of our partners. If you would prefer not to receive future e-mail, mail to:Contacter at yiwu.com?subject=REMOVE ************************************************************************ From gvermeul at grenoble.cnrs.fr Mon Jul 7 06:03:16 2003 From: gvermeul at grenoble.cnrs.fr (Gerard Vermeulen) Date: Mon Jul 7 06:03:16 2003 Subject: [Numpy-discussion] Announcing PyQwt-3.7 Message-ID: <20030707150111.76d80d0d.gvermeul@grenoble.cnrs.fr> PyQwt-3.7 = FAST and EASY data plotting for Python and Qt. PyQwt is a set of Python bindings for the Qwt C++ class library. Qwt extends the Qt framework with widgets for scientific and engineering applications. PyQwt really shines with Numeric and/or numarray. Numeric and numarray extend Python with new data types that make Python an ideal language for numerical computing and experimentation. PyQwt requires and extends PyQt, a set of Python bindings for Qt. PyQwt runs on Windows and Unix/Linux. The home page of PyQwt has moved to http://pyqwt.sourceforge.net. New features in PyQwt-3.7: 1. PyQwt will work with either Numeric, or numarray or both (depending on the presence of Numeric and numarray during PyQwt's build). 2. PyQwt will work without Numeric and numarray (is not recommended). 3. PyQwt is compatible with the Python Command Line Interpreter or IPython, provided that the readline module is installed: Qt's event processing is scheduled by the readline library through (int)(*PyOS_InputHook)(void). 4. PyQwt is always rlcompleter-friendly, even though PyQt-3.6 and earlier are not (the dir() function has been enhanced in PyQt-3.7). 5. The module qwt.qplt is enhanced: qwt.qplt is sugar coating for the QwtPlot widget to facilitate plotting from an interpreter. 6. QwtImagePlot maps a 2-dimensional array of z-values on a QImage using a color scale. 7. New Qwt widgets: QwtDial and QwtCompass. 8. Works with PyQt-3.7, PyQt-3.6, PyQt-3.5 and PyQt-3.4. 9. Works with Qt-2.3.x, Qt-3.0.x and Qt-3.1.x. Gerard Vermeulen From o.mekkaoui at free.fr Fri Jul 11 02:45:52 2003 From: o.mekkaoui at free.fr (o.mekkaoui) Date: Fri Jul 11 02:45:52 2003 Subject: [Numpy-discussion] linking Python, GSL and mysql Message-ID: <3F0E7DD7.4050003@free.fr> Hi, I used Numeric, GSL and mysql to create some C python extension. The objective is to make requests and after are stocked in a python array. So this work fine with python1.5 and Numeric17 using: gcc -c GnoStructTC.c -DHAVE_CONFIG_H -I/usr/include/python-I/usr/lib/python/config1.5 -I/usr/inlude/mysql -I/usr/lib/mysql gcc -shared GnoStructTC.o -lgsl -lgslcblas -lmysqlclient -o GnoStructTC.so Now, with Python 2.2 and Numeric22 : this don't work (default segmentation) and I can't create my array On other hand, if I just create simple array using gcc -c GnoStructTC.c -DHAVE_CONFIG_H -I/usr/include/python2.2 -I/usr/lib/python2.2/config gcc -shared GnoStructTC.o -o GnoStructTC.so there are no problem. Perhaps there are some mistakes in the compilation or a conflit between Numeric and GSL. Any idea. Thanks in advance. From vip2000 at yahoo.com Fri Jul 11 11:04:15 2003 From: vip2000 at yahoo.com (vip2000 at yahoo.com) Date: Fri Jul 11 11:04:15 2003 Subject: [Numpy-discussion] please get back to me !!! Message-ID: An HTML attachment was scrubbed... URL: From 238122 at mail.com Mon Jul 14 18:02:25 2003 From: 238122 at mail.com (238122 at mail.com) Date: Mon Jul 14 18:02:25 2003 Subject: [Numpy-discussion] Copy DVD's to a standard CD - without a DVD Burner 238122 Message-ID: An HTML attachment was scrubbed... URL: From jmiller at stsci.edu Tue Jul 15 12:32:23 2003 From: jmiller at stsci.edu (Todd Miller) Date: Tue Jul 15 12:32:23 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? Message-ID: <1058297679.25273.13.camel@halloween.stsci.edu> I am adding arrays of Python objects to numarray and so I am curious about the uses people have found for Numeric's object arrays. If you have found Numeric's object arrays useful, please tell us about what you used them for so that we can make certain that numarray can satisfy the same need. Thanks, Todd -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From hinsen at cnrs-orleans.fr Wed Jul 16 02:27:17 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Wed Jul 16 02:27:17 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058297679.25273.13.camel@halloween.stsci.edu> References: <1058297679.25273.13.camel@halloween.stsci.edu> Message-ID: <200307161126.11107.hinsen@cnrs-orleans.fr> On Tuesday 15 July 2003 21:34, Todd Miller wrote: > I am adding arrays of Python objects to numarray and so I am curious > about the uses people have found for Numeric's object arrays. If you > have found Numeric's object arrays useful, please tell us about what > you used them for so that we can make certain that numarray can satisfy > the same need. I have used them several times in order to be able to use array operations on number-like objects, e.g. multiple precision numbers, quaternions, automatic derivatives, polynomials, etc. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From jmiller at stsci.edu Wed Jul 16 09:30:18 2003 From: jmiller at stsci.edu (Todd Miller) Date: Wed Jul 16 09:30:18 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <200307161126.11107.hinsen@cnrs-orleans.fr> References: <1058297679.25273.13.camel@halloween.stsci.edu> <200307161126.11107.hinsen@cnrs-orleans.fr> Message-ID: <1058372983.3465.69.camel@localhost.localdomain> On Wed, 2003-07-16 at 05:26, Konrad Hinsen wrote: > On Tuesday 15 July 2003 21:34, Todd Miller wrote: > > I am adding arrays of Python objects to numarray and so I am curious > > about the uses people have found for Numeric's object arrays. If you > > have found Numeric's object arrays useful, please tell us about what > > you used them for so that we can make certain that numarray can satisfy > > the same need. > > I have used them several times in order to be able to use array operations on > number-like objects, e.g. multiple precision numbers, quaternions, automatic > derivatives, polynomials, etc. OK. Right now the prototype supports array structural operations (indexing, slicing, array indexing, copies, views, transpose...) and element-wise operator application (so when you add two object arrays, the corresponding objects are added using the number protocol). Support for universal functions (calling numarray.add(a,b) rather than a+b) and the C-API for object arrays is still missing. Did these matter to your application of object arrays? -- Todd Miller From hinsen at cnrs-orleans.fr Wed Jul 16 10:36:03 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Wed Jul 16 10:36:03 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058372983.3465.69.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <200307161126.11107.hinsen@cnrs-orleans.fr> <1058372983.3465.69.camel@localhost.localdomain> Message-ID: <200307161934.13611.hinsen@cnrs-orleans.fr> On Wednesday 16 July 2003 18:29, you wrote: > Support for universal functions (calling numarray.add(a,b) rather than > a+b) and the C-API for object arrays is still missing. Did these matter > to your application of object arrays? Not add(a, b), but add.reduce(a) as well as things like log(a). Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From jmiller at stsci.edu Wed Jul 16 10:50:36 2003 From: jmiller at stsci.edu (Todd Miller) Date: Wed Jul 16 10:50:36 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <200307161934.13611.hinsen@cnrs-orleans.fr> References: <1058297679.25273.13.camel@halloween.stsci.edu> <200307161126.11107.hinsen@cnrs-orleans.fr> <1058372983.3465.69.camel@localhost.localdomain> <200307161934.13611.hinsen@cnrs-orleans.fr> Message-ID: <1058377806.3466.98.camel@localhost.localdomain> On Wed, 2003-07-16 at 13:34, Konrad Hinsen wrote: > On Wednesday 16 July 2003 18:29, you wrote: > > > Support for universal functions (calling numarray.add(a,b) rather than > > a+b) and the C-API for object arrays is still missing. Did these matter > > to your application of object arrays? > > Not add(a, b), but add.reduce(a) as well as things like log(a). OK. That makes sense. I have a fair amount of work left to do... > Konrad. -- Todd Miller From tchur at optushome.com.au Wed Jul 16 14:46:06 2003 From: tchur at optushome.com.au (Tim Churches) Date: Wed Jul 16 14:46:06 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058297679.25273.13.camel@halloween.stsci.edu> References: <1058297679.25273.13.camel@halloween.stsci.edu> Message-ID: <1058391802.1206.31.camel@emilio> On Wed, 2003-07-16 at 05:34, Todd Miller wrote: > I am adding arrays of Python objects to numarray and so I am curious > about the uses people have found for Numeric's object arrays. If you > have found Numeric's object arrays useful, please tell us about what > you used them for so that we can make certain that numarray can satisfy > the same need. We use NumPy to store vectors (rank-1 arrays) of numbers representing columns in a dataset. The NumPy arrays, which are large and numerous) are memory-mapped (using an extension) to disc to conserve real memory. However, in some vectors (columns) we need to store variable-length, and in others, variable length sequences of integers or floats (and possibly even sets in the future). NumPy's object arrays are more memory-efficient that Python lists of lists or lists of strings from these purposes, and of course they support NumPy functions such as take(), which makes life simpler. But we haven't been able to memory-map these object arrays, which is a problem. Is there any prospect of numarray supporting memory-mapped arrays of sequences/strings? I know that is a big ask! We have an extension module which stores variable length blobs in a single memory-mapped file which might be useful - the code could be made available to the numarray project, I think. We also use MA extensively (because in the health care domain life is full of missing data) - I'll jot down some thoughts on how MA could be improved in the next few days. -- Tim C PGP/GnuPG Key 1024D/EAF993D0 available from keyservers everywhere or at http://members.optushome.com.au/tchur/pubkey.asc Key fingerprint = 8C22 BF76 33BA B3B5 1D5B EB37 7891 46A9 EAF9 93D0 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From jmiller at stsci.edu Wed Jul 16 15:37:04 2003 From: jmiller at stsci.edu (Todd Miller) Date: Wed Jul 16 15:37:04 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058391802.1206.31.camel@emilio> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> Message-ID: <1058394996.6996.40.camel@localhost.localdomain> On Wed, 2003-07-16 at 17:43, Tim Churches wrote: > On Wed, 2003-07-16 at 05:34, Todd Miller wrote: > > I am adding arrays of Python objects to numarray and so I am curious > > about the uses people have found for Numeric's object arrays. If you > > have found Numeric's object arrays useful, please tell us about what > > you used them for so that we can make certain that numarray can satisfy > > the same need. > > We use NumPy to store vectors (rank-1 arrays) of numbers representing > columns in a dataset. The NumPy arrays, which are large and numerous) > are memory-mapped (using an extension) to disc to conserve real memory. > However, in some vectors (columns) we need to store variable-length, and > in others, variable length sequences of integers or floats (and possibly > even sets in the future). NumPy's object arrays are more > memory-efficient that Python lists of lists or lists of strings from Well, right now the prototype actually uses a single list internally as the object store; still, we might beat out lists of lists by a small margin. > these purposes, and of course they support NumPy functions such as > take(), which makes life simpler. The prototype currently uses common code for put/take on strings, object arrays, and soon record arrays. The common code is currently Python prototype. Numarray numeric arrays use specialized C-code for speed. > But we haven't been able to memory-map > these object arrays, which is a problem. Is there any prospect of > numarray supporting memory-mapped arrays of sequences/strings? numarray supports arrays of fixed length strings with its chararray module. The default chararray string stripping and padding functions blank fill unused space and give the appearance of variable length strings. The data buffers of all of numarray's classes which represent primitive data items (numbers, strings, records) can be memory mapped. I think however that memory mapping sequences or arbitrary Python objects isn't going to happen in numarray any time soon; it sounds too much like object persistence. > I know > that is a big ask! We have an extension module which stores variable > length blobs in a single memory-mapped file which might be useful - the > code could be made available to the numarray project, I think. I don't understand the difference between your module and Python's mmap. > > We also use MA extensively (because in the health care domain life is > full of missing data) - I'll jot down some thoughts on how MA could be > improved in the next few days. I'd be very interested in hearing your thoughts on improving MA. -- Todd Miller From djc at object-craft.com.au Wed Jul 16 18:14:06 2003 From: djc at object-craft.com.au (Dave Cole) Date: Wed Jul 16 18:14:06 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058394996.6996.40.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> Message-ID: >>>>> "Todd" == Todd Miller writes: Todd> I think however that memory mapping sequences or arbitrary Todd> Python objects isn't going to happen in numarray any time soon; Todd> it sounds too much like object persistence. It is used to minimize the cost of huge datasets. >> I know that is a big ask! We have an extension module which stores >> variable length blobs in a single memory-mapped file which might be >> useful - the code could be made available to the numarray project, >> I think. Todd> I don't understand the difference between your module and Todd> Python's mmap. The code could use probably the Python mmap module. It would be difficult because all access to the Python mmap object is via Python. A CObject exported API in the Python mmap module would be very useful. - Dave -- http://www.object-craft.com.au From miquels at sandelman.ottawa.on.ca Thu Jul 17 01:03:01 2003 From: miquels at sandelman.ottawa.on.ca (miquels at sandelman.ottawa.on.ca) Date: Thu Jul 17 01:03:01 2003 Subject: [Numpy-discussion] new mail NaHZuBL5 In-Reply-To: References: Message-ID: English version | ??????? ??????? ?? ???? ?????????? ??? ????? ?????????? ???????? ?????? http://www.mail15.com. ??? ????????????? ???????????: 1) ?????? ????? 15 ??; 2) ???????????? ? ??????????; 3) ??????????? ????????????? ????? ???????? ????????(POP,IMAP,SMTP); 4) ?????? ?? ?????? ????? ? ????? ?????; 5) ??????? ? ????????? ???????????? ? ?????? ??????????? ???????; 6) ???????????? ? ???????????? ????????; 7) ?????????? ????????? ?????. ???? ?? ?? ?????? ???????? ????? ?????? ????????, ?????? mailto:unsubscribe at mail15.com?subject=unsubscribe ************* We are glad to invite you at new free mail service http://www.mail15.com. The advantages of this service are: 1) mailbox, up to 15 Mb; 2) absolute privacy and high reliability; 3) ability to use mail clients (POP3, IMAP4, SMTP); 4) access from anywhere, anytime; 5) flexible light-weight web interface without advertising banners; 6) antivirus and antispam control; 7) fast mail transfer; 8) high speed network channel; 9) flexible light-weight web interface; 10) wide spread ability of mail filtering and forwarding mail; 11) clock around support; If you wish to be removed: mailto:unsubscribe at mail15.com?subject=unsubscrib wRhv8A69w9 From jmiller at stsci.edu Thu Jul 17 03:30:01 2003 From: jmiller at stsci.edu (Todd Miller) Date: Thu Jul 17 03:30:01 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> Message-ID: <1058437751.3466.26.camel@localhost.localdomain> On Wed, 2003-07-16 at 21:13, Dave Cole wrote: > >>>>> "Todd" == Todd Miller writes: > > Todd> I think however that memory mapping sequences or arbitrary > Todd> Python objects isn't going to happen in numarray any time soon; > Todd> it sounds too much like object persistence. > > It is used to minimize the cost of huge datasets. That's what we use it for too... but only for primitive data types. > > >> I know that is a big ask! We have an extension module which stores > >> variable length blobs in a single memory-mapped file which might be > >> useful - the code could be made available to the numarray project, > >> I think. > > Todd> I don't understand the difference between your module and > Todd> Python's mmap. > > The code could use probably the Python mmap module. It would be > difficult because all access to the Python mmap object is via Python. > > A CObject exported API in the Python mmap module would be very useful. > What do you want to get via the CObject API? Since any mmap can be treated as a buffer, it's easy to get a pointer and size via the Python buffer API in C. Is there something else you need? > - Dave -- Todd Miller From jmiller at stsci.edu Thu Jul 17 04:12:24 2003 From: jmiller at stsci.edu (Todd Miller) Date: Thu Jul 17 04:12:24 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> <1058437751.3466.26.camel@localhost.localdomain> Message-ID: <1058440332.3463.81.camel@localhost.localdomain> On Thu, 2003-07-17 at 06:44, Dave Cole wrote: > >>>>> "Todd" == Todd Miller writes: > > Todd> I don't understand the difference between your module and > Todd> Python's mmap. > > >> The code could use probably the Python mmap module. It would be > >> difficult because all access to the Python mmap object is via > >> Python. > >> > >> A CObject exported API in the Python mmap module would be very > >> useful. > >> > > Todd> What do you want to get via the CObject API? Since any mmap can > Todd> be treated as a buffer, it's easy to get a pointer and size via > Todd> the Python buffer API in C. Is there something else you need? > > Nope. I wonder why I didn't realise that... Too stupid I suppose. I doubt that or you wouldn't be using Python... The buffer API is just a little obscure. > > - Dave -- Todd Miller From djc at object-craft.com.au Thu Jul 17 04:26:29 2003 From: djc at object-craft.com.au (Dave Cole) Date: Thu Jul 17 04:26:29 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058437751.3466.26.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> <1058437751.3466.26.camel@localhost.localdomain> Message-ID: >>>>> "Todd" == Todd Miller writes: Todd> I don't understand the difference between your module and Todd> Python's mmap. >> The code could use probably the Python mmap module. It would be >> difficult because all access to the Python mmap object is via >> Python. >> >> A CObject exported API in the Python mmap module would be very >> useful. >> Todd> What do you want to get via the CObject API? Since any mmap can Todd> be treated as a buffer, it's easy to get a pointer and size via Todd> the Python buffer API in C. Is there something else you need? Nope. I wonder why I didn't realise that... Too stupid I suppose. - Dave -- http://www.object-craft.com.au From yeahme at 163.net Fri Jul 18 08:37:09 2003 From: yeahme at 163.net (yeahme at 163.net) Date: Fri Jul 18 08:37:09 2003 Subject: [Numpy-discussion] you didn't reply my email ? why ? ??? Message-ID: An HTML attachment was scrubbed... URL: From jmiller at stsci.edu Fri Jul 18 13:43:06 2003 From: jmiller at stsci.edu (Todd Miller) Date: Fri Jul 18 13:43:06 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 Message-ID: <1058559987.970.24.camel@halloween.stsci.edu> I have just uploaded numarray-0.6 to Source Forge. http://sourceforge.net/project/showfiles.php?group_id=1369 This is the first release with numarray repackaged as a Python package. I. ENHANCEMENTS 1. Repackaging numarray has been modified from a collection of Python modules into a Python package. See Doc/Repackaging in the source distribution for more details. 2. Median Filter Function See numarray.image.combine.median for a function which computes the median pixels in a stack of images. 3. Thread Safety Work Modifications to ufunc caching and IEEE error handling enable numarray to work in multi-threaded programs. II. BUGS FIXED 733534 Broadcasts of non-array sequences fails 733535 NA_typeNoToTypeObject sometimes fails 736674 PyArray_ContiguousFromObject() fails for some scalars 737041 Build failure on Cygwin 1.3.22 (very current install). 750320 CharArray.raw() is broken 750326 building RPMS fails 754836 Missing Src/_convmodule.c during setup 756050 chararray multi-d copy fails for recarray 772519 memory.new_memory() 64-bit scanning bug III. CAUTIONS 1. Due to the distribution repackaging, numarray-0.6 will not install correctly on top of an existing numarray installation. Before installing numarray-0.6 remove your old version of numarray. -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From falted at openlc.org Sat Jul 19 01:11:20 2003 From: falted at openlc.org (Francesc Alted) Date: Sat Jul 19 01:11:20 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: <1058559987.970.24.camel@halloween.stsci.edu> References: <1058559987.970.24.camel@halloween.stsci.edu> Message-ID: <200307191009.47736.falted@openlc.org> Hi, I've detected a problem during installation. It seems like if safethread module is out of the final package: inspiron:~/PyTables/pytables-0.6$ python2.3 Python 2.3b2 (#1, Jul 7 2003, 18:07:41) [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from numarray import * Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/site-packages/numarray/__init__.py", line 1, in ? from numarrayall import * File "/usr/local/lib/python2.3/site-packages/numarray/numarrayall.py", line 2, in ? from generic import * File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 918, in ? import numarraycore as _nc File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line 1125, in ? import ufunc File "/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", line 16, in ? import safethread ImportError: No module named safethread However, I have copied it after a previous CVS version, and that seems enough: >>> from numarray import * >>> import numarray.testall as testall >>> testall.test() *** Tester.merge: 'numarray.numtest.ratioarr' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.comparr' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.dtp' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.test' in both testers; summing outcomes. *** Tester.merge: 'numarray.numtest.dummy' in both testers; summing outcomes. numeric: (0, 1037) records: (0, 48) strings: (0, 168) memmap: (0, 75) -- Francesc Alted From karczma at info.unicaen.fr Sat Jul 19 02:12:09 2003 From: karczma at info.unicaen.fr (Jerzy Karczmarczuk) Date: Sat Jul 19 02:12:09 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 References: <1058559987.970.24.camel@halloween.stsci.edu> Message-ID: <3F190AE8.3060106@info.unicaen.fr> Todd Miller wrote: > I have just uploaded numarray-0.6 to Source Forge. > > http://sourceforge.net/project/showfiles.php?group_id=1369 > > This is the first release with numarray repackaged as a Python package. GREAT. And what is even more great - I see that the version adapted to Python 2.3 is there. In some private exchange I read "of course we will upgrade, but 2.3 is beta, let's wait when it stabilizes". I sincerely think that all essential goodies (and numarray is one of them) should evolve in parallel with the kernel. Personally I wouldn't touch new versions of Python without having those additional goodies, since I wouldn't know what to do with it. Just playing with Guido's tutorial, or what? Thank you. Jerzy Karczmarczuk Caen, France From jmiller at stsci.edu Sat Jul 19 03:50:14 2003 From: jmiller at stsci.edu (Todd Miller) Date: Sat Jul 19 03:50:14 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: <200307191009.47736.falted@openlc.org> References: <1058559987.970.24.camel@halloween.stsci.edu> <200307191009.47736.falted@openlc.org> Message-ID: <1058611912.3462.35.camel@localhost.localdomain> I forgot to regenerate the MANIFEST so the .tar.gz source was incomplete. It's fixed now. Todd On Sat, 2003-07-19 at 04:09, Francesc Alted wrote: > Hi, > > I've detected a problem during installation. It seems like if safethread > module is out of the final package: > > inspiron:~/PyTables/pytables-0.6$ python2.3 > Python 2.3b2 (#1, Jul 7 2003, 18:07:41) > [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from numarray import * > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site-packages/numarray/__init__.py", line 1, > in ? > from numarrayall import * > File "/usr/local/lib/python2.3/site-packages/numarray/numarrayall.py", line > 2, in ? > from generic import * > File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 918, > in ? > import numarraycore as _nc > File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line > 1125, in ? > import ufunc > File "/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", line 16, in > ? > import safethread > ImportError: No module named safethread > > However, I have copied it after a previous CVS version, and that seems enough: > > >>> from numarray import * > >>> import numarray.testall as testall > >>> testall.test() > *** Tester.merge: 'numarray.numtest.ratioarr' in both testers; summing > outcomes. > *** Tester.merge: 'numarray.numtest.comparr' in both testers; summing > outcomes. > *** Tester.merge: 'numarray.numtest' in both testers; summing outcomes. > *** Tester.merge: 'numarray.numtest.dtp' in both testers; summing outcomes. > *** Tester.merge: 'numarray.numtest.test' in both testers; summing outcomes. > *** Tester.merge: 'numarray.numtest.dummy' in both testers; summing outcomes. > numeric: (0, 1037) > records: (0, 48) > strings: (0, 168) > memmap: (0, 75) -- Todd Miller From haase at msg.ucsf.edu Sun Jul 20 13:13:08 2003 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Sun Jul 20 13:13:08 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: <1058611912.3462.35.camel@localhost.localdomain> Message-ID: Congratulations ! And thanks for the nice work -- I'm going upgrade tomorrow... And this time even the new documentation is already online ;-) [It's just somewhat sad that google still points to the 'numarray has moved!' page] Question: In an email from May-20th (actually regarding rel.0.5) Todd wrote: "However, there is a new API function which I added in response to your last post: NA_NewAllFromBuffer() which enables you to create arrays in C from existing buffer objects rather than just C arrays." The 0.6 documentation doesn't mention that function - for now I probably have to read the source, right ? BTW - We are already using a self-made version of that - allowing us to access the CCD images that get acquired from our Microspcope (mostly C++ code) as a 16-bit unsigned int numarray - in real time! --- It's just great, and people love it. Thanks, Sebastian Haase On 19 Jul 2003 06:51:53 -0400 Todd Miller wrote: >I forgot to regenerate the MANIFEST so the .tar.gz source >was >incomplete. It's fixed now. > >Todd > >On Sat, 2003-07-19 at 04:09, Francesc Alted wrote: >> Hi, >> >> I've detected a problem during installation. It seems >>like if safethread >> module is out of the final package: >> >> inspiron:~/PyTables/pytables-0.6$ python2.3 >> Python 2.3b2 (#1, Jul 7 2003, 18:07:41) >> [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 >> Type "help", "copyright", "credits" or "license" for >>more information. >> >>> from numarray import * >> Traceback (most recent call last): >> File "", line 1, in ? >> File >>"/usr/local/lib/python2.3/site-packages/numarray/__init__.py", >>line 1, >> in ? >> from numarrayall import * >> File >>"/usr/local/lib/python2.3/site-packages/numarray/numarrayall.py", >>line >> 2, in ? >> from generic import * >> File >>"/usr/local/lib/python2.3/site-packages/numarray/generic.py", >>line 918, >> in ? >> import numarraycore as _nc >> File >>"/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", >>line >> 1125, in ? >> import ufunc >> File >>"/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", >>line 16, in >> ? >> import safethread >> ImportError: No module named safethread >> >> However, I have copied it after a previous CVS version, >>and that seems enough: >> >> >>> from numarray import * >> >>> import numarray.testall as testall >> >>> testall.test() >> *** Tester.merge: 'numarray.numtest.ratioarr' in both >>testers; summing >> outcomes. >> *** Tester.merge: 'numarray.numtest.comparr' in both >>testers; summing >> outcomes. >> *** Tester.merge: 'numarray.numtest' in both testers; >>summing outcomes. >> *** Tester.merge: 'numarray.numtest.dtp' in both >>testers; summing outcomes. >> *** Tester.merge: 'numarray.numtest.test' in both >>testers; summing outcomes. >> *** Tester.merge: 'numarray.numtest.dummy' in both >>testers; summing outcomes. >> numeric: (0, 1037) >> records: (0, 48) >> strings: (0, 168) >> memmap: (0, 75) >-- >Todd Miller > > > >------------------------------------------------------- >This SF.net email is sponsored by: VM Ware >With VMware you can run multiple operating systems on a >single machine. >WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual >machines at the >same time. Free trial click here: >http://www.vmware.com/wl/offer/345/0 >_______________________________________________ >Numpy-discussion mailing list >Numpy-discussion at lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/numpy-discussion From jmiller at stsci.edu Mon Jul 21 04:00:09 2003 From: jmiller at stsci.edu (Todd Miller) Date: Mon Jul 21 04:00:09 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 In-Reply-To: References: Message-ID: <1058785119.3460.30.camel@localhost.localdomain> On Sun, 2003-07-20 at 16:12, Sebastian Haase wrote: > Congratulations ! Thanks! > And thanks for the nice work -- I'm > going upgrade tomorrow... Great. > And this time even the new documentation is already online > ;-) [It's just somewhat sad that google still points to > the 'numarray has moved!' page] > > Question: In an email from May-20th (actually regarding > rel.0.5) Todd wrote: > "However, there is a new API function which I added in > response to your > last post: NA_NewAllFromBuffer() which enables you to > create arrays in C > from existing buffer objects rather than just C arrays." > > The 0.6 documentation doesn't mention that function - for > now I probably have to read the source, right ? Yes. The signature is: PyArrayObject * NA_NewAllFromBuffer (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) Please try it out. > BTW - We are already using a self-made version of that - > allowing us to access the CCD images that get acquired > from our Microspcope (mostly C++ code) as a 16-bit > unsigned int numarray - in real time! --- It's just great, > and people love it. Excellent. That's good to hear! > Thanks, > Sebastian Haase -- Todd Miller From falted at openlc.org Thu Jul 24 00:30:01 2003 From: falted at openlc.org (Francesc Alted) Date: Thu Jul 24 00:30:01 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <1058394996.6996.40.camel@localhost.localdomain> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> Message-ID: <200307240928.45091.falted@openlc.org> Some time ago, talking about object arrays Todd Miller wrote: A Dijous 17 Juliol 2003 00:36, Todd Miller va escriure: > The prototype currently uses common code for put/take on strings, object > arrays, and soon record arrays. I am thinking on supporting multimensional arrays of record arrays soon in pytables. From your words, it seems that you are planning implementing this in the next release of numarray, isn't it? That would be nice. -- Francesc Alted From maurice at akst.tn.tudelft.nl Thu Jul 24 02:26:02 2003 From: maurice at akst.tn.tudelft.nl (Maurice van de Rijzen) Date: Thu Jul 24 02:26:02 2003 Subject: [Numpy-discussion] How to compute gradients or derivatives. Message-ID: <3F1FC40E.6050601@akst.tn.tudelft.nl> Dear all, I was lookogn for u numerical extension to python and was therefore glad that i ran into numpy. I did all the calculations on mataln and I want to migrate to python. Numpy and numarray pretend to have the basic functionality of matlab and therefore i expected als a function that is able to compute gradients of high-order arrays which is a basic matlab thing. I could not find something like that. I found something in SciPy but I think that this one cannot compute high-order arrays. I'm thinkin of something as in matlab e.g. say that T=f(x,y,z,p) [gx,gy] = gradientT; Is something like that possible? Thanks in advance From jsaenz at wm.lc.ehu.es Thu Jul 24 04:52:14 2003 From: jsaenz at wm.lc.ehu.es (Jon Saenz) Date: Thu Jul 24 04:52:14 2003 Subject: [Numpy-discussion] How to compute gradients or derivatives. In-Reply-To: <3F1FC40E.6050601@akst.tn.tudelft.nl> Message-ID: take a look to some parts of the code in http://www.pyclimate.org. There are some functions to compute gradients, divergence and vertical component of the rotational of scalar and vector fields. BUT... we only support regular grids in a certain ordering, which is the one most used for climate data sets. Moreover, our derivatives are computed in spherical coordinates, like the ones used in geophysical data sets. Still, you can use the code as a starting point to develop your own functions. Jon Saenz. | Tfno: +34 946012445 Depto. Fisica Aplicada II | Fax: +34 944648500 Facultad de Ciencias. \\ Universidad del Pais Vasco \\ Apdo. 644 \\ 48080 - Bilbao \\ SPAIN On Thu, 24 Jul 2003, Maurice van de Rijzen wrote: > Dear all, > > I was lookogn for u numerical extension to python and was therefore glad > that i ran into numpy. > I did all the calculations on mataln and I want to migrate to python. > Numpy and numarray pretend to have the basic functionality of matlab and > therefore i expected als a function that is able to compute gradients of > high-order arrays which is a basic matlab thing. I could not find > something like that. I found something in SciPy but I think that this > one cannot compute high-order arrays. > I'm thinkin of something as in matlab e.g. say that T=f(x,y,z,p) > > [gx,gy] = gradientT; > > Is something like that possible? > > Thanks in advance > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > From jmiller at stsci.edu Thu Jul 24 05:09:05 2003 From: jmiller at stsci.edu (Todd Miller) Date: Thu Jul 24 05:09:05 2003 Subject: [Numpy-discussion] Object arrays for numarray / What do you use Numeric object arrays for? In-Reply-To: <200307240928.45091.falted@openlc.org> References: <1058297679.25273.13.camel@halloween.stsci.edu> <1058391802.1206.31.camel@emilio> <1058394996.6996.40.camel@localhost.localdomain> <200307240928.45091.falted@openlc.org> Message-ID: <1059048474.22473.6.camel@halloween.stsci.edu> On Thu, 2003-07-24 at 03:28, Francesc Alted wrote: > Some time ago, talking about object arrays Todd Miller wrote: > > A Dijous 17 Juliol 2003 00:36, Todd Miller va escriure: > > The prototype currently uses common code for put/take on strings, object > > arrays, and soon record arrays. > > I am thinking on supporting multimensional arrays of record arrays soon in > pytables. From your words, it seems that you are planning implementing this > in the next release of numarray, isn't it? That would be nice. Yes. The main feature of the next release will be support for arrays of Objects, similar to Numeric's typecode='O' arrays. > > -- > Francesc Alted > > -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From travis at enthought.com Fri Jul 25 11:32:03 2003 From: travis at enthought.com (Travis N. Vaught) Date: Fri Jul 25 11:32:03 2003 Subject: [Numpy-discussion] [ANN] SciPy 03 Workshop - Scientific Computing with Python Message-ID: <007601c352da$e1d75680$0200a8c0@tvlaptop> ------------------ SciPy '03 Workshop ------------------ The SciPy '03 Workshop on Scientific Computing with Python is being held at Cal Tech again this year. Online registration is now available. After last year's success, we expect another great turnout with compelling presentations/tutorials. It is a two day workshop held September 11-12 in Pasadena, CA. More information may be found at: http://www.scipy.org/site_content/scipy03 Online registration is available at: https://www.enthought.com/scipy03 Please register early. Last minute registrants will have to suffer the indignity of a handwritten name tag. It currently looks like breakfast (bagels, etc.), lunch and supper will be provided Thursday, and breakfast and lunch will be provided Friday. Discussion about the workshop may be directed to the SciPy-user mailing list (http://www.scipy.org/site_content/MailList) to which you may post messages at scipy-user at scipy.org. Presenters: If you would like to present at the workshop, there are two formats: - Lightning Talks: Short (5-15 minute) presentations of a particular scientific problem solved with Python. - Presentations: Traditional presentation format ~45 minute talks. If you would like to present, contact Eric Jones at eric at enthought.com. For any other questions, please feel free to call or email Travis Vaught: travis at enthought.com, (512)536-1057. You can call the same number to register via phone (Business Hours CST). Links: SciPy.org community site: http://www.scipy.org Workshop Home: http://www.scipy.org/site_content/scipy03 Summary of last year's workshop: http://www.scipy.org/site_content/scipy02/scipy02summary.htm From rmgolbeck at transilvania.eu.org Sat Jul 26 05:37:02 2003 From: rmgolbeck at transilvania.eu.org (rmgolbeck at transilvania.eu.org) Date: Sat Jul 26 05:37:02 2003 Subject: [Numpy-discussion] new mail UwEuOebt In-Reply-To: References: Message-ID: ?? ???? ?????????? ??? ????? ?????????? ???????? ?????? http://www.mail15.com. ??? ????????????? ???????????: 1) ?????? ????? 15 ??; 2) ???????????? ? ??????????; 3) ??????????? ????????????? ????? ???????? ????????(POP,IMAP,SMTP); 4) ?????? ?? ?????? ????? ? ????? ?????; 5) ??????? ? ????????? ???????????? ? ?????? ??????????? ???????; 6) ???????????? ? ???????????? ????????; 7) ?????????? ????????? ?????. ???? ?? ?? ?????? ???????? ????? ?????? ????????, ?????? mailto:unsubscribe at mail15.com?subject=unsubscribe ************* We are glad to invite you at new free mail service http://www.mail15.com. The advantages of this service are: 1) mailbox, up to 15 Mb; 2) absolute privacy and high reliability; 3) ability to use mail clients (POP3, IMAP4, SMTP); 4) access from anywhere, anytime; 5) flexible light-weight web interface without advertising banners; 6) antivirus and antispam control; 7) fast mail transfer; 8) high speed network channel; 9) flexible light-weight web interface; 10) wide spread ability of mail filtering and forwarding mail; 11) clock around support; If you wish to be removed: mailto:unsubscribe at mail15.com?subject=unsubscrib R2t0vLtgLZ From nwagner at mecha.uni-stuttgart.de Mon Jul 28 06:40:14 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon Jul 28 06:40:14 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix Message-ID: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> Hi all, How can I delete a column/row from a matrix. In Matlab: >> a=rand(4,4) a = 0.9501 0.8913 0.8214 0.9218 0.2311 0.7621 0.4447 0.7382 0.6068 0.4565 0.6154 0.1763 0.4860 0.0185 0.7919 0.4057 use >> a(:,2)=[] a = 0.9501 0.8214 0.9218 0.2311 0.4447 0.7382 0.6068 0.6154 0.1763 0.4860 0.7919 0.4057 >> a(2,:)=[] a = 0.9501 0.8214 0.9218 0.6068 0.6154 0.1763 0.4860 0.7919 0.4057 >> Is there something similar in scipy, numpy or numarray ? Any suggestion ? Nils From hinsen at cnrs-orleans.fr Mon Jul 28 07:11:03 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Mon Jul 28 07:11:03 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> Message-ID: <200307281609.18652.hinsen@cnrs-orleans.fr> > How can I delete a column/row from a matrix. As an in-place operation, not at all. To get a copy of an array with some columns/rows removed, use Numeric.take. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From nwagner at mecha.uni-stuttgart.de Mon Jul 28 07:30:10 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon Jul 28 07:30:10 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> <200307281609.18652.hinsen@cnrs-orleans.fr> Message-ID: <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> Konrad Hinsen schrieb: > > > How can I delete a column/row from a matrix. > > As an in-place operation, not at all. To get a copy of an array with some > columns/rows removed, use Numeric.take. > The in-place operation of matlab is a nice feature. Is it thinkable to have this in scipy or numarray at a later date ? Nils > Konrad. > -- > ------------------------------------------------------------------------------- > Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr > Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 > Rue Charles Sadron | Fax: +33-2.38.63.15.17 > 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ > France | Nederlands/Francais > ------------------------------------------------------------------------------- > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion From perry at stsci.edu Mon Jul 28 07:35:10 2003 From: perry at stsci.edu (Perry Greenfield) Date: Mon Jul 28 07:35:10 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> Message-ID: > > Konrad Hinsen schrieb: > > > > > How can I delete a column/row from a matrix. > > > > As an in-place operation, not at all. To get a copy of an array > with some > > columns/rows removed, use Numeric.take. > > > The in-place operation of matlab is a nice feature. Is it thinkable to > have this > in scipy or numarray at a later date ? > > Nils > Speaking for numarray, no, not really. But I wonder what is really done for matlab. Either they have a more complex representation of arrays, or all they really are doing is making a new copy of the array and giving you the impression it is being done in place. After all you are changing the size and structure of the array. Perry From hinsen at cnrs-orleans.fr Mon Jul 28 07:42:11 2003 From: hinsen at cnrs-orleans.fr (Konrad Hinsen) Date: Mon Jul 28 07:42:11 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> <200307281609.18652.hinsen@cnrs-orleans.fr> <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> Message-ID: <200307281640.34643.hinsen@cnrs-orleans.fr> On Monday 28 July 2003 16:26, Nils Wagner wrote: > Konrad Hinsen schrieb: > > > How can I delete a column/row from a matrix. > > > > As an in-place operation, not at all. To get a copy of an array with some > > columns/rows removed, use Numeric.take. > > The in-place operation of matlab is a nice feature. Is it thinkable to > have this > in scipy or numarray at a later date ? I'd say that the obvious way to implement it is as del a[2:3,:] That can certainly be done, but someone has to do it. Personally, I am not convinced that it is very useful. The consequences of an in-place change can be disastrous when many references point to that array. But then, we have other in-place operations which sometimes are handy, so my usefulness estimation may be wrong. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- From juenglin at informatik.uni-freiburg.de Mon Jul 28 08:11:06 2003 From: juenglin at informatik.uni-freiburg.de (Ralf Juengling) Date: Mon Jul 28 08:11:06 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: References: Message-ID: <1059404954.4091.4.camel@alpspitze.cse.ogi.edu> On Mon, 2003-07-28 at 07:34, Perry Greenfield wrote: > Speaking for numarray, no, not really. But I wonder what is > really done for matlab. Either they have a more complex representation > of arrays, or all they really are doing is making a new copy of > the array and giving you the impression it is being done in place. Right, this is how Matlab does it behind the scenes. Ralf From nwagner at mecha.uni-stuttgart.de Mon Jul 28 08:23:08 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon Jul 28 08:23:08 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix References: <3F2526F3.70F9B095@mecha.uni-stuttgart.de> <200307281609.18652.hinsen@cnrs-orleans.fr> <3F2532A1.1DD9418E@mecha.uni-stuttgart.de> <200307281640.34643.hinsen@cnrs-orleans.fr> Message-ID: <3F253F02.F953C6D6@mecha.uni-stuttgart.de> Konrad Hinsen schrieb: > > On Monday 28 July 2003 16:26, Nils Wagner wrote: > > Konrad Hinsen schrieb: > > > > How can I delete a column/row from a matrix. > > > > > > As an in-place operation, not at all. To get a copy of an array with some > > > columns/rows removed, use Numeric.take. > > > > The in-place operation of matlab is a nice feature. Is it thinkable to > > have this > > in scipy or numarray at a later date ? > > I'd say that the obvious way to implement it is as > > del a[2:3,:] > > That can certainly be done, but someone has to do it. > > Personally, I am not convinced that it is very useful. The consequences of an > in-place change can be disastrous when many references point to that array. > But then, we have other in-place operations which sometimes are handy, so my > usefulness estimation may be wrong. > > Konrad. In my opinion, this operation is quite useful. For example a finite element model where we have to impose several homogeneous boundary conditions. This can be done by deleting columns and associated rows. Nils In any case I am interested in a reliable workaround for this feature. A small example would be appreciated. Thanks in advance. > -- > ------------------------------------------------------------------------------- > Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr > Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 > Rue Charles Sadron | Fax: +33-2.38.63.15.17 > 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ > France | Nederlands/Francais > ------------------------------------------------------------------------------- > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion From haase at msg.ucsf.edu Mon Jul 28 14:03:04 2003 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Mon Jul 28 14:03:04 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 References: <1058785119.3460.30.camel@localhost.localdomain> Message-ID: <015501c3554b$827f39f0$421ee6a9@rodan> > > "However, there is a new API function which I added in > > response to your > > last post: NA_NewAllFromBuffer() which enables you to > > create arrays in C > > from existing buffer objects rather than just C arrays." > > > > The 0.6 documentation doesn't mention that function - for > > now I probably have to read the source, right ? > > Yes. The signature is: > > PyArrayObject * NA_NewAllFromBuffer (int ndim, maybelong *shape, > NumarrayType type, PyObject *bufferObject, maybelong byteoffset, > maybelong bytestride, int byteorder, int aligned, int writeable) > Seems to work right away. But now I get this: >>> r = na.array( [ 2,3,4,5] , type=F.na.Float32 ) >>> r array([ 2., 3., 4., 5.], type=Float32) >>> r/10 Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for /: 'NumArray' and 'int' >>> r/10. Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for /: 'NumArray' and 'float' >>> Sorry to frighten you... :-( I am just experimenting with from __future__ import division Apparently taking that line out again fixes the problem. I am actually not sure what the "proposed policy" is on that future division thing; I just thought I could simplify some explanation to non-Python people if 1/3 is not 0. Probably numarray has more important things to worry about - but maybe you can put it on the list.. Thanks for your work. Sebastian From jmiller at stsci.edu Mon Jul 28 14:14:10 2003 From: jmiller at stsci.edu (Todd Miller) Date: Mon Jul 28 14:14:10 2003 Subject: [Numpy-discussion] ANNOUNCE: numarray-0.6 References: <1058785119.3460.30.camel@localhost.localdomain> <015501c3554b$827f39f0$421ee6a9@rodan> Message-ID: <001001c3554d$1ac0c6b0$e4eda782@stsci.edu> ----- Original Message ----- From: "Sebastian Haase" To: "Todd Miller" Cc: "numpy-discussion" Sent: Monday, July 28, 2003 5:02 PM Subject: Re: [Numpy-discussion] ANNOUNCE: numarray-0.6 > Seems to work right away. > But now I get this: > >>> r = na.array( [ 2,3,4,5] , type=F.na.Float32 ) > >>> r > array([ 2., 3., 4., 5.], type=Float32) > >>> r/10 > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsupported operand type(s) for /: 'NumArray' and 'int' > >>> r/10. > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsupported operand type(s) for /: 'NumArray' and 'float' > >>> > > Sorry to frighten you... :-( > I am just experimenting with > from __future__ import division > We have't added support for future division yet. > Apparently taking that line out again fixes the problem. Good. > I am actually not sure what the "proposed policy" is on that future division > thing; I just thought I could simplify some explanation to non-Python people > if 1/3 is not 0. I believe we're going to support future division eventually. I'm not sure how soon. > Probably numarray has more important things to worry about - but maybe you > can put it on the list.. It's on "the list". > Thanks for your work. You're welcome. I hope you find it useful. > Sebastian > From Boostings at freemail.soim.com Tue Jul 29 01:28:13 2003 From: Boostings at freemail.soim.com (Laura) Date: Tue Jul 29 01:28:13 2003 Subject: [Numpy-discussion] Grow Your Customers Message-ID: E-mail Marketing is one of the most effective and inexpensive ways to promote your products and services. We offer a complete E-mail Marketing solution with quality service and the lowest prices. The result is that you will enjoy more success. 1. Targeted E-mail Addresses We can supply targeted e-mail addresses according to your requirements, which are compiled only on your order, such as region / country / field / occupation / Domain Name etc. We will customize your customer e-mail addresses. * We have millions of e-mail addresses in a wide variety of categories. 2. Targeted Mailing If you are worried about any complications or consequences with sending out targeted e-mails, or want to avoid the work of sending out targeted e-mails. We will do it for you! We can send your e-mail message to your targeted customers. * We can Bullet-Proof your Web Site. We also offer a wide variety of e-mail marketing software. For more details, you can refer to our web site: http://www.aid-biz.com Our services will help you get more business opportunities. Regards! Ms Laura www.aid-biz.com Customer Support E-mail Marketing, at Great Fees. ************************************************************************ Receiving this email because you registered to receive special offers from one of our partners. If you would prefer not to receive future e-mail, Click here: Booster at ywzc.net?subject=REMOVE ************************************************************************ From jdhunter at ace.bsd.uchicago.edu Tue Jul 29 09:33:02 2003 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue Jul 29 09:33:02 2003 Subject: [Numpy-discussion] assigning to submatrix Message-ID: If I have a large matrix, say a = zeros( (20,20) ) and a small matrix b = ones( 3,4 ) and a list of row indices and a list of col indices rind = [2,4,9,15] cind = [1,4,12] what is the best way to assign the submatrix to a[rind,cind]. I understand this is possible in numarray, but is there a good way to do it in Numeric? In matlab, you could do a(rind, cind)=b; Is there some reshape, put magic I can do to make this efficient in Numeric? Thanks, John Hunter From perry at stsci.edu Tue Jul 29 10:49:10 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 10:49:10 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > -----Original Message----- > From: numpy-discussion-admin at lists.sourceforge.net > [mailto:numpy-discussion-admin at lists.sourceforge.net]On Behalf Of John > Hunter > Sent: Tuesday, July 29, 2003 12:30 PM > To: Numerical Python Discussion > Subject: [Numpy-discussion] assigning to submatrix > > > > If I have a large matrix, say > > a = zeros( (20,20) ) > > and a small matrix > > b = ones( 3,4 ) > > and a list of row indices and a list of col indices > > rind = [2,4,9,15] > cind = [1,4,12] > > what is the best way to assign the submatrix to a[rind,cind]. I > understand this is possible in numarray, but is there a good way to do > it in Numeric? > > In matlab, you could do a(rind, cind)=b; Is there some reshape, put > magic I can do to make this efficient in Numeric? > > Thanks, > John Hunter > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072 > 303_01/01 > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > From perry at stsci.edu Tue Jul 29 11:00:04 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 11:00:04 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > If I have a large matrix, say > > a = zeros( (20,20) ) > > and a small matrix > > b = ones( 3,4 ) > > and a list of row indices and a list of col indices > > rind = [2,4,9,15] > cind = [1,4,12] > > what is the best way to assign the submatrix to a[rind,cind]. I > understand this is possible in numarray, but is there a good way to do > it in Numeric? > > In matlab, you could do a(rind, cind)=b; Is there some reshape, put > magic I can do to make this efficient in Numeric? > > Thanks, > John Hunter Note that numarray doesn't do the same thing as matlab in this regard. In particular, the expression a[rind, cind] = b would fail since it is expecting an array on the right hand side that is the same shape as the index arrays. The assignment here is taken to mean: a[rind[0], cind[0]] = b[0] a[rind[1], cind[1]] = b[1] etc. not: a[rind[0], cind[0]] = b[0,0] etc. To do what you want doesn't currently have any atomic operation in numarray. Is this widely used? At the moment I think you would be forced to iterate over one dimension. E.g., for i in range(len(rind)): a[cind, rind[i]] = b[:, i] [Note that I reordered the index arrays to match b; I wasn't sure what was intended] There may be some clever way to avoid the explicit looping. Nothing prevents the addition of such a feature to numarray (other than work!), but it would likely have to use a function. I think the current defintion of how multiple index puts and takes work with brackets is more useful than the interpretation you are using and isn't likely to change. Perry From perry at stsci.edu Tue Jul 29 11:25:03 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 11:25:03 2003 Subject: [Numpy-discussion] Removing rows and columns of a matrix Message-ID: Nils Wagner writes: > > In any case I am interested in a reliable workaround for this feature. > > A small example would be appreciated. > Thanks in advance. > Numarray (and Numeric to a certain extent) currently is centered around what rows or columns you want rather than those you don't. Writing a reasonably efficient function to do this in a more convenient way is not hard. Here is an example for numarray (not tested, nor does it have any error checking to ensure the input array has sufficient dimensions or that the index is within the array bounds): def remove(arr, index, dim=0): """Remove subarray at index and dimension specified""" # make selected dimension the first one swparr = swapaxes(arr, 0, dim) indices = range(swparr.shape[0]) del indices[index] newarray = swparr[indices] # reorder axes as they originally appeared. return swapaxes(newarray, 0, dim) Then you can say x = remove(x, 5) to remove the 6th row or x = remove(x, 4, dim=1) to remove the 5th column. (depending on what you call rows or columns; in the examples I'm taking an image-oriented view rather than a matrix-oriented view) Perry From jmiller at stsci.edu Tue Jul 29 11:39:05 2003 From: jmiller at stsci.edu (Todd Miller) Date: Tue Jul 29 11:39:05 2003 Subject: [Numpy-discussion] Mac problem with numarray-0.6; use numarray-0.6.1 source Message-ID: <1059502562.2322.54.camel@halloween.stsci.edu> I discovered today (some bug reports have hinted at this but didn't spell it out completely) that I forgot Mac OS 10 testing for numarray-0.6. As it turns out, the numarray examples and add-ons don't compile correctly due to a small untested change. I corrected the problem and uploaded a new tarball to Source Forge: http://osdn.dl.sourceforge.net/sourceforge/numpy/numarray-0.6.1.tar.gz Non-Mac users of numarray-0.6 should just ignore numarray-0.6.1. This is a source update only. Todd -- Todd Miller jmiller at stsci.edu STSCI / ESS / SSB From wagner.nils at vdi.de Tue Jul 29 12:07:03 2003 From: wagner.nils at vdi.de (Nils Wagner) Date: Tue Jul 29 12:07:03 2003 Subject: [SciPy-user] RE: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: Message-ID: ------------------- Nils Wagner writes: > > In any case I am interested in a reliable workaround for this feature. > > A small example would be appreciated. > Thanks in advance. > Numarray (and Numeric to a certain extent) currently is centered around what rows or columns you want rather than those you don't. Writing a reasonably efficient function to do this in a more convenient way is not hard. Here is an example for numarray (not tested, nor does it have any error checking to ensure the input array has sufficient dimensions or that the index is within the array bounds): def remove(arr, index, dim=0): """Remove subarray at index and dimension specified""" # make selected dimension the first one swparr = swapaxes(arr, 0, dim) indices = range(swparr.shape[0]) del indices[index] newarray = swparr[indices] # reorder axes as they originally appeared. return swapaxes(newarray, 0, dim) Then you can say x = remove(x, 5) to remove the 6th row or x = remove(x, 4, dim=1) to remove the 5th column. (depending on what you call rows or columns; in the examples I'm taking an image-oriented view rather than a matrix-oriented view) Perry Perry, Thank you for your reply. Unfortunately, I am not familiar with numarray. This is the output of my test program. from scipy import * from RandomArray import * from numarray import * def remove(arr, index, dim=0): """Remove subarray at index and dimension specified""" # make selected dimension the first one swparr = swapaxes(arr, 0, dim) indices = range(swparr.shape[0]) del indices[index] newarray = swparr[indices] # reorder axes as they originally appeared. return swapaxes(newarray, 0, dim) #Then you can say a = rand(5,5) print a a = remove(a, 2) print a #to remove the 3th row or #to remove the 3th column a = remove(a, 2, dim=1) print a [[ 0.87329948 0.81829292 0.72929943 0.13012239 0.49291104] [ 0.58665377 0.78030288 0.85906255 0.11409029 0.77719343] [ 0.01325159 0.03389675 0.25417367 0.51117259 0.61979091] [ 0.32406124 0.24500449 0.06147733 0.04323368 0.64497042] [ 0.10133368 0.25028452 0.33645368 0.34395722 0.34052679]] Traceback (most recent call last): File "nils.py", line 19, in ? a = remove(a, 2) File "nils.py", line 8, in remove swparr = swapaxes(arr, 0, dim) File "/usr/lib/python2.2/site-packages/numarray/generic.py", line 855, in swapaxes v = _nc.inputarray(array).view() File "/usr/lib/python2.2/site-packages/numarray/numarraycore.py", line 310, in inputarray return array(seq, type=type, typecode=typecode, copy=0) File "/usr/lib/python2.2/site-packages/numarray/numarraycore.py", line 303, in array raise ValueError("Unknown input type") ValueError: Unknown input type Any idea ? Nils _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From perry at stsci.edu Tue Jul 29 12:25:02 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 12:25:02 2003 Subject: [SciPy-user] RE: [Numpy-discussion] Removing rows and columns of a matrix In-Reply-To: Message-ID: > from scipy import * > from RandomArray import * > from numarray import * > I believe the problem is in this part. You are getting some functions (like rand) which return a numeric array which some numarray functions don't recognize (we will be fixing this soon, they should accept any Python sequence that fits the basic requirements). For the moment you will need to generate a numarray array for that function to work. In the latest release you would do the imports as follows (for version 0.6 and later) from numarray.numeric import * from numarray.random_array import * a = random((5,5)) and so forth Perry From jdhunter at ace.bsd.uchicago.edu Tue Jul 29 12:58:03 2003 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue Jul 29 12:58:03 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: ("Perry Greenfield"'s message of "Tue, 29 Jul 2003 13:46:57 -0400") References: Message-ID: >>>>> "Perry" == Perry Greenfield writes: Perry> [Note that I reordered the index arrays to match b; I Perry> wasn't sure what was intended] Yep, I think that was a blooper on my part; to be precise, here is the matlab code a = zeros( 8,8 ); b = ones( 3,4 ); rind = [2,4,6]; cind = [1,4,5,6]; a(rind, cind) = b; and the equivalent python from Numeric import * a = zeros( (8,8) ) b = ones( (3,4) ) rind = [1,3,5] cind = [0,3,4,5] for ia, ib in zip(rind, range(len(rind))): for ja, jb in zip(cind, range(len(cind))): a[ia,ja] = b[ib,jb] print a And the question is: is there a good way to avoid the double loop using Numeric? Thanks, John From perry at stsci.edu Tue Jul 29 13:24:10 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 13:24:10 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > for ia, ib in zip(rind, range(len(rind))): > for ja, jb in zip(cind, range(len(cind))): > a[ia,ja] = b[ib,jb] > print a > > And the question is: is there a good way to avoid the double loop > using Numeric? > > Thanks, > John > At least one way, but it isn't particularly convenient or pretty (though the ugly details could be hidden in a function). (and I warn you, I haven't tested this, but something like this ought to work) # produce all possible combinations of rind and cind as # indices into an equivalent flattened for a indices = add.outer(rind*a.shape[1],cind).flat put(a, indices, b.flat) One can do this for numarray as well in a bit more straightforward way (depending on your view) [again, untested] t = ones(b.shape) a[multiply.outer(rind,t[0]),cind*t] = b In other words, this constructs two index arrays, one for each dimension, each with the same shape as the source array, b where the locations in that array correspond to the desired index in the source array. For numeric, you must do all the selection on a 1-d array, hence the index arithmetic. Perry From perry at stsci.edu Tue Jul 29 13:25:02 2003 From: perry at stsci.edu (Perry Greenfield) Date: Tue Jul 29 13:25:02 2003 Subject: [Numpy-discussion] assigning to submatrix In-Reply-To: Message-ID: > # produce all possible combinations of rind and cind as > # indices into an equivalent flattened for a > indices = add.outer(rind*a.shape[1],cind).flat > put(a, indices, b.flat) > Whoops! I suppose that should be: put(a.flat, indices, b.flat) From aleaxit at yahoo.com Thu Jul 31 09:08:02 2003 From: aleaxit at yahoo.com (Alex Martelli) Date: Thu Jul 31 09:08:02 2003 Subject: [Numpy-discussion] buglet in interaction between pygame, Numeric & copy in Python 2.3 Message-ID: <200307311806.12701.aleaxit@yahoo.com> I'm sending this buglet-report to the discussion lists for each of pygame, Numeric, and Python-Dev, because it ends with a recommendation for changes (at least to docs) in each of the two extension packages and Python 2.3.1. I'm not a regular user of pygame [I am one of Numeric]. I helped some pygame users find out why their program was breaking (in just one point) when migrating Python 2.2 -> 2.3 (Numeric 23.0, pygame 1.5.6 from cvs snapshot). The problem can be narrowed down the following little buglet.py script: import copy, pygame.display, pygame.surfarray screen = pygame.display.set_mode((640,480),0,24) surf = pygame.surfarray.pixels3d(screen) xx = copy.copy(surf[10:20,30]) With python 2.2, this runs without errors. With 2.3: Traceback (most recent call last): File "buglet.py", line 6, in ? xx = copy.copy(surf[10:20,30]) File "/usr/local/lib/python2.3/copy.py", line 101, in copy raise Error("un(shallow)copyable object of type %s" % cls) copy.Error: un(shallow)copyable object of type Workaround for the problem: add an "import Numeric" at the top of buglet.py. Reason for the problem: copy.copy uses different mechanisms in 2.3 vs 2.2 for shallow copies of Numeric.array instances. In 2.2, it looked for a method __copy__ on the instance, found it, and happily used it. In 2.3, it relies on getting a 'reductor' function from the copy_reg.dispatch_table. Module Numeric installs such a reductor *WHEN IMPORTED* -- but pygame never imports it even though functions such as the above-used pixels3d do return instances of Numeric.array. So, Numeric.py doesn't run, and therefore cannot install its pickle_array function with the copy_reg module. Suggested fix in pygame: I would suggest making sure Numeric has been imported when Numeric.array instances are to be returned. That's up to the pygame maintainers, of course; at the very least, I think this issue should be mentioned in pygame's docs (asking the user to make sure "import Numeric" happens in any pygame-using program that manipulates such instances). Suggested fix in Numeric: Numeric cannot DO anything much about this issue, I think, but it should probably *mention* (in the docs regarding interfacing to Numeric from other C-coded extensions) that other extensions should make sure Numeric is _imported_ (from a Python POV), if said extensions return instances of Numeric.array, to ensure such instances have full functionality (and in particular shallow copyability). Suggested fix in Python: a mention in the "what's new" document, section "porting to Python 2.3", is probably warranted -- not so much about Numeric and/or pygame extensions per se, though these are both popular 3rd party extensions, but rather the excellent changes in the shallow copy mechanics, which may indeed require code changes on the part of extension authors. Thanks, Alex From falted at openlc.org Thu Jul 31 15:55:11 2003 From: falted at openlc.org (Francesc Alted) Date: Thu Jul 31 15:55:11 2003 Subject: [Numpy-discussion] ANN: PyTables 0.7 Message-ID: <200308010054.21757.falted@openlc.org> Announcing PyTables 0.7 ----------------------- PyTables is a hierarchical database package designed to efficently manage very large amounts of data. PyTables is built on top of the HDF5 library and the numarray package and features an object-oriented interface that, combined with C-code generated from Pyrex sources, makes it a fast, yet extremely easy to use tool for interactively save and retrieve large amounts of data. Release 0.7 is the third public beta release. The version 0.6 was internal and will never be released. On this release you will find: - new AttributeSet class - 25% I/O speed improvement - fully multidimensional table cells support - new column descriptors - row deletion in tables is finally here - much more! More in detail: What's new ----------- - A new AttributeSet class has been added. This will allow the addition and deletion of generic attributes (any scalar type plus any Python object supported by Pickle) as easy as this: table.attrs.date = "2003/07/28 10:32" # Attach a string to table group._v_attrs.tempShift = 1.2 # Attach a float to group array.attrs.detectorList = [1,2,3,4] # Attach a list to array del array.attrs.detectorList # Detach detectorList attr from array - PyTables now has support for fully multidimensional table cells. This has been made possible in part by implementation of multidimensional cells in numarray.records.RecArray object. Thanks to numarray crew, and especially to Jin-chung Hsu, for willingly accepting to do that, and also for including some cache improvements in RecArray. - New column descriptors added: IntCol, Int8Col, UInt8Col, Int16Col, UInt16Col, Int32Col, UInt32Col, Int64Col, UInt64Col, FloatCol, Float32Col, Float64Col and StringCol. I think they are more explicit and easy-to-use than the now deprecated (but still supported) Col() descriptor. All the examples and user's manual has been accordingly updated. - The new Table.removeRows(start, stop) function allows you to remove rows from tables. This feature was requested a long time ago. There are still limitations, however: you cannot delete rows in extremely large Tables (as the remaining rows after the stop parameter are stored in memory). Nor is the performance optimized. These issues will hopefully be addressed in future releases. - Added iterators to File, Group and Table (they now support the special __iter__() method). They make the object much more user-friendly, especially in interactive mode. See documentation for usage examples. - Added a __getitem__() method to Table that works more or less like read(), but with extended slices support. - As a consequence of rewriting table iterators in C (with the help of Pyrex, of course) the table read performance has been improved between 20% and 30%. Data selections in PyTables are now starting to beat powerful relational databases like SQLite, even compared to in-core selects (!). I think there is still room for another 20% or 30% speed improvement, so stay tuned. - A checksum is now added automatically when using LZO (not with UCL where I'm having some difficulties implementing that capability). The Adler32 algorithm has been chosen because of its speed. With that, the compressing/decompressing speed has dropped 1% or 2%, which is hardly noticeable. I think this addition will allow the cautious user to be a bit more confident about this excellent compressor. Code has been added to be able to read files created without this checksum (so you can be confident that you will be able to read your existing files compressed with LZO and UCL). - Recursion has been removed from PyTables. Before, this made the maximum depth tree to be less than the Python recursion limit (which depends on implementation, but is around 900, at least in Linux). Now, the limit has been set (somewhat arbitrarily) at 2048. Thanks to John Nielsen for implementing the new iterative method!. - A new rootUEP parameter to openFile() has been added. You can now define the root from which you want to start to build the object tree. Thanks to John Nielsen for the suggestion and a first implementation. - A small bug fixed when dealing with non-native PyTables files that prevented the use of the "classname" filter during a listNodes() call. Thanks to Jeff Robbins for reporting that. - Some (non-serious) bugs were discovered and fixed. - Updated documentation to explain all these new bells and whistles. It is also available on the web: http://pytables.sourceforge.net/html-doc/usersguide-html.html - Added more unit tests (more than 350 now!) - PyTables 0.7 *needs* numarray 0.6 or higher and HDF-1.6.0 or higher to compile and work. It has been tested with Python 2.2 and 2.3 and should work fine on both versions. What is a table? ---------------- A table is defined as a collection of records whose values are stored in fixed-length fields. All records have the same structure and all values in each field have the same data type. The terms "fixed-length" and "strict data types" seems to be quite a strange requirement for an language like Python, that supports dynamic data types, but they serve a useful function if the goal is to save very large quantities of data (such as is generated by many scientific applications, for example) in an efficient manner that reduces demand on CPU time and I/O resources. What is HDF5? ------------- For those people who know nothing about HDF5, it is is a general purpose library and file format for storing scientific data made at NCSA. HDF5 can store two primary objects: datasets and groups. A dataset is essentially a multidimensional array of data elements, and a group is a structure for organizing objects in an HDF5 file. Using these two basic constructs, one can create and store almost any kind of scientific data structure, such as images, arrays of vectors, and structured and unstructured grids. You can also mix and match them in HDF5 files according to your needs. Platforms --------- I'm using Linux as the main development platform, but PyTables should be easy to compile/install on other UNIX machines. This package has also passed all the tests on a UltraSparc platform with Solaris 7 and Solaris 8. It also compiles and passes all the tests on a SGI Origin2000 with MIPS R12000 processors and running IRIX 6.5. Regarding Windows platforms, PyTables has been tested with Windows 2000 and Windows XP, but it should also work with other flavors. An example? ----------- For online code examples, have a look at http://pytables.sourceforge.net/tut/tutorial1-1.html and http://pytables.sourceforge.net/tut/tutorial1-2.html Web site -------- Go to the PyTables web site for more details: http://pytables.sourceforge.net/ Share your experience --------------------- Let me know of any bugs, suggestions, gripes, kudos, etc. you may have. Have fun! -- Francesc Alted falted at openlc.org