[Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread laurent . feron
Hello, if i multiply two matrix, one with a unique line and the second one with a unique column, i should have a scalar: line matrix([[1, 3, 1]]) col matrix([[2], [2], [2]]) line*col matrix([[10]]) Matlab give me a scalar, Numpy does not... Do you know why? Regards,

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Francesc Alted
A Wednesday 03 February 2010 08:42:57 David Cournapeau escrigué: Yes, it means distributors of packages that depend on NumPy will have to recompile against the new version, and I can see why some might want to avoid that. Pushing what is really a distribution problem back to the NumPy

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Peter Notebaert
From an extension? How to import numpy from there and then test if that succeeded and that without any annoying message if possible... Thanks, Peter On Wed, Feb 3, 2010 at 1:34 AM, David Cournapeau da...@silveregg.co.jpwrote: Peter Notebaert wrote: How can I test if numpy is installed on

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread David Cournapeau
On Wed, Feb 3, 2010 at 5:38 PM, Peter Notebaert p...@telenet.be wrote: From an extension? How to import numpy from there and then test if that succeeded and that without any annoying message if possible... One obvious solution would be to simply call PyImport_Import, something like: #include

[Numpy-discussion] numpy.left_shift with negative x2

2010-02-03 Thread markus . proeller
Hello, the following operation seems strange to me np.left_shift(2,-1) 0 I would have expected a right_shift by one. The documentation on http://docs.scipy.org/doc/numpy/reference/generated/numpy.left_shift.html#numpy.left_shift also says that the operation is equivalent to multiplying x1 by

Re: [Numpy-discussion] numpy.left_shift with negative x2

2010-02-03 Thread Ralf Gommers
On Wed, Feb 3, 2010 at 8:43 PM, markus.proel...@ifm.com wrote: Hello, the following operation seems strange to me np.left_shift(2,-1) 0 I would have expected a right_shift by one. I wouldn't expect anything, the behavior is simply not defined. Python returns an error: In [17]: 2 -1

[Numpy-discussion] Antwort: Re: numpy.left_shift with negative x2

2010-02-03 Thread markus . proeller
On Wed, Feb 3, 2010 at 8:43 PM, markus.proel...@ifm.com wrote: Hello, the following operation seems strange to me np.left_shift(2,-1) 0 I would have expected a right_shift by one. I wouldn't expect anything, the behavior is simply not defined. But it would prevent a

Re: [Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread Alan G Isaac
On 2/3/2010 3:08 AM, laurent.fe...@free.fr wrote: if i multiply two matrix, one with a unique line and the second one with a unique column, i should have a scalar What definition of matrix multiplication is that?? If you really want a scalar product, ask for it:: import numpy as np

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Robert Kern
On Wed, Feb 3, 2010 at 03:41, David Cournapeau courn...@gmail.com wrote: On Wed, Feb 3, 2010 at 5:38 PM, Peter Notebaert p...@telenet.be wrote: From an extension? How to import numpy from there and then test if that succeeded and that without any annoying message if possible... One obvious

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Peter Notebaert
Ah, that is maybe the idea: if (_import_array() 0) { /* Clear the error state since we are handling the error. */ PyErr_Clear(); /* ... set up for the sans-numpy case. */ } else { /* ... set up for the with-numpy case. */ } I did not call PyErr_Clear() when _import_array() 0 and

Re: [Numpy-discussion] numpy.left_shift with negative x2

2010-02-03 Thread Charles R Harris
On Wed, Feb 3, 2010 at 5:43 AM, markus.proel...@ifm.com wrote: Hello, the following operation seems strange to me np.left_shift(2,-1) 0 I would have expected a right_shift by one. The result of a shift by a negative number is undefined in the C language; the gcc compiler will issue a

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Christopher Barker
David Cournapeau wrote: Just so that there is no confusion: it is only about removing it for 1.4.x, not about removing datetime altogether. It seems that datetime in 1.4.x has few users, Of course it has few users -- it's brand new! whereas breaking ABI is a nuisance for many more

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread josef . pktd
On Wed, Feb 3, 2010 at 12:16 PM, Christopher Barker chris.bar...@noaa.gov wrote: David Cournapeau wrote: Just so that there is no confusion: it is only about removing it for 1.4.x, not about removing datetime altogether. It seems that datetime in 1.4.x has few users, Of course it has few

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Robert Kern
On Tue, Feb 2, 2010 at 23:45, Travis Oliphant oliph...@enthought.com wrote: I consider ABI a very significant think.  We should be very accurate about when a re-compile is required.    I just don't believe that we should be promising ABI compatibility at .X releases.   I never had that

[Numpy-discussion] [ANN] New package for manipulating labeled arrays

2010-02-03 Thread Keith Goodman
I am pleased to announce the first release of the la package, version 0.1. The main class of the la package is a labeled array, larry. A larry consists of a data array and a label list. The data array is stored as a NumPy array and the label list as a list of lists. larry has built-in methods

Re: [Numpy-discussion] Determine if numpy is installed from anextension

2010-02-03 Thread Peter Notebaert
Just to imform that my approach works: if (_import_array() 0) { /* Clear the error state since we are handling the error. */ PyErr_Clear(); /* ... set up for the sans-numpy case. */ } else { /* ... set up for the with-numpy case. */ } It is based on Roberts idea to call

Re: [Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread laurent . feron
Thanks all for your replies... yes i start with numpy. i translate a dtw algorithm for voice recogniton from matlab to python Rgds, Laurent - Mail Original - De: Alan G Isaac ais...@american.edu À: Discussion of Numerical Python numpy-discussion@scipy.org Envoyé: Mercredi 3 Février 2010

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread David Cournapeau
On Thu, Feb 4, 2010 at 2:16 AM, Christopher Barker chris.bar...@noaa.gov wrote: David Cournapeau wrote: Just so that there is no confusion: it is only about removing it for 1.4.x, not about removing datetime altogether. It seems that datetime in 1.4.x has few users, Of course it has few

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
A more important scenario is as follows: let's assume we do allow breaking the ABI every 1.X release, meaning that an ABI incompatible change happens every ~ 6 months at the current pace (using the last 2-3 years as history). If the issue is having too many releases that are .X

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: Travis Oliphant wrote: On Feb 2, 2010, at 11:46 PM, David Cournapeau wrote: On Wed, Feb 3, 2010 at 12:23 PM, David Cournapeau da...@silveregg.co.jp mailto:da...@silveregg.co.jp wrote: Sorry, my question was badly worded: besides the

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Wed, Feb 3, 2010 at 11:46 PM, Travis Oliphant oliph...@enthought.comwrote: A more important scenario is as follows: let's assume we do allow breaking the ABI every 1.X release, meaning that an ABI incompatible change happens every ~ 6 months at the current pace (using the last 2-3

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Wed, Feb 3, 2010 at 11:48 PM, Travis Oliphant oliph...@enthought.comwrote: On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: Travis Oliphant wrote: On Feb 2, 2010, at 11:46 PM, David Cournapeau wrote: On Wed, Feb 3, 2010 at 12:23 PM, David Cournapeau da...@silveregg.co.jp

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
On Feb 3, 2010, at 11:58 AM, Robert Kern wrote: On Tue, Feb 2, 2010 at 23:45, Travis Oliphant oliph...@enthought.com wrote: I consider ABI a very significant think. We should be very accurate about when a re-compile is required.I just don't believe that we should be promising ABI

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Thu, Feb 4, 2010 at 12:11 AM, Travis Oliphant oliph...@enthought.comwrote: On Feb 3, 2010, at 11:58 AM, Robert Kern wrote: On Tue, Feb 2, 2010 at 23:45, Travis Oliphant oliph...@enthought.com wrote: I consider ABI a very significant think. We should be very accurate about when a

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
On Feb 4, 2010, at 12:59 AM, Charles R Harris wrote: On Wed, Feb 3, 2010 at 11:48 PM, Travis Oliphant oliph...@enthought.com wrote: On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: Travis Oliphant wrote: On Feb 2, 2010, at 11:46 PM, David Cournapeau wrote: On Wed, Feb 3, 2010

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Thu, Feb 4, 2010 at 12:37 AM, Travis Oliphant oliph...@enthought.comwrote: On Feb 4, 2010, at 12:59 AM, Charles R Harris wrote: On Wed, Feb 3, 2010 at 11:48 PM, Travis Oliphant oliph...@enthought.comwrote: On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: Travis Oliphant wrote: