[Numpy-discussion] convention in numpy.correlate?

2006-09-06 Thread PGM
Folks,
I need to compute some cross-correlations between time series, and I naturally 
started to use numpy.correlate. Howver, I'm not sure about the convention 
being used:
The crosscorrelation is usually defined as 
$\gamma_{xy}[k]  = \sum_{i}{x[i] y[i+k]}$
So, when I compute
>>> numpy.dot(x[:-1],y[1:])
on two 1D series of same size $n$, I should have $\gamma[1]$.
With numpy.correlate, I have to use 
>>>numpy.correlate(x,y,'full')[(n-1)-1]
or reverse x and y to get $\gamma[1]$
Is that correct ? 
P.

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Seguridad Santander (Actualizacion)

2006-09-06 Thread Santander Serfin
Title: Actualizacion




 
Estimado Cliente, 
Según nuestros registros informáticos, hemos 
  detectado recientemente que los
 accesos a su cuenta 
  a través de Banca en la Red han sido realizados 
  desde diferentes direcciones IP. 
 
 Esto seguramente se debe a que la dirección IP de su 
computador es dinámica y varía constantemente, 
o 
  debido a que usted ha utilizado mas de un computador 
  para acceder a su cuenta.
 
Debido a este suceso y en cumplimiento con la nueva 
normativa vigente,
 hemos actualizado nuestros 
  sistemas informáticos para brindar una mayor 
  seguridad a nuestros clientes,
por lo cual 
  necesitaremos que ingrese en su cuenta y efectúe una 
  verificación de su actividad reciente. 
Los 
  procedimientos de seguridad requieren que usted 
  verifique 
la actividad en su cuenta antes del 20 de Agosto del 2006. 
 
Transcurrida esa fecha, el sistema informático 
  automatizado dara de baja su cuenta. 
Asi mismo le 
  recordamos que este correo no es para verificar los 
  datos de su tarjeta 
es solo para verificar la 
  actividad,  ya que no lo hacemos.
  
De ante mano le agradecemos su cooperación en este 
  aspecto.
 

  Para ingresar a su cuenta a través de Banca en la 
  Red y verificar la actividad de la misma, debe 
  utilizar el siguiente enlace: 
 
Para Personas:
  
http://www.santander.com.mx/Personas/login.asp?verificaridentidad=true&controlacceso=true
			Para Empresas:
			 http://www.santander.com.mx/empresas/login.asp?verificaridentidad=true&controlacceso=true
			Para Banca Privada:
			
			http://www.santander.com.mx/bancaprivada/login.asp?verificaridentidad=true&controlacceso=true
 
Banco Santander Serfin, 
			S.A., 2006





-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] numpy.fftpack: axis=None ?

2006-09-06 Thread PGM
Folks,
I was playing around the numpy.fftpack when I ran into the problem below:
it seems that axis=None is not valid with fft. Is there a reason for that ? I 
was assuming a behavior similar to other functions, where axis=None 
translates to "use a flat array".

--
>>> N.fft.fft(N.arange(100).reshape(10,10),128,None)  
/usr/lib64/python2.4/site-packages/numpy/fft/fftpack.py in fft(a, n, axis)
 85 different n's."""
 86
---> 87 return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftf, 
_fft_cache)
 88
 89

/usr/lib64/python2.4/site-packages/numpy/fft/fftpack.py in _raw_fft(a, n, 
axis, init_function, work_function, fft_cache)
 44 fft_cache[n] = wsave
 45
---> 46 if a.shape[axis] != n:
 47 s = list(a.shape)
 48 if s[axis] > n:

TypeError: tuple indices must be integers
-

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread Ryan Krauss
I am a Linux user trying to install Numpy/Scipy on a Windows machine
in my office.

I went to the website and grabbed the two latest versions:
scipy = scipy-0.5.0.win32-py2.4.exe
numpy = numpy-1.0b5.win32-py2.4.exe


Trying to import scipy I get:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
Overwriting info= from scipy.misc.helpmod (was  from numpy.lib.utils)
Overwriting who= from scipy.misc.common (was  from numpy.lib.utils)
Overwriting source= from scipy.misc.helpmod (was
 from numpy.lib.utils)
RuntimeError: module compiled against version 100 of C-API but this version
of numpy is 102
Fatal Python error: numpy.core.multiarray failed to import... exiting.


I read about this problem on the list and there was mention of needing
a different Numpy version.  With a slightly older Numpy I got
(numpy-0.9.8.win32-py2.4.exe):

Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\Lib\site-packages\scipy\__init__.py", line 32, in ?
from numpy import oldnumeric
ImportError: cannot import name oldnumeric


Are there windows installers available for compatible versions of
Scipy and Numpy?

Thanks,

Ryan

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread Martin Spacek
Ryan,

Try installing the latest scipy version 0.51. There's a windows binary 
for it. Worked fine for me.

Martin

Ryan Krauss wrote:
> I am a Linux user trying to install Numpy/Scipy on a Windows machine
> in my office.
> 
> I went to the website and grabbed the two latest versions:
> scipy = scipy-0.5.0.win32-py2.4.exe
> numpy = numpy-1.0b5.win32-py2.4.exe
> 
>

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread Ryan Krauss
I would be glad to try that.  Where do I get the installer for scipy 0.51?

Thanks,

Ryan

On 9/6/06, Martin Spacek <[EMAIL PROTECTED]> wrote:
> Ryan,
>
> Try installing the latest scipy version 0.51. There's a windows binary
> for it. Worked fine for me.
>
> Martin
>
> Ryan Krauss wrote:
> > I am a Linux user trying to install Numpy/Scipy on a Windows machine
> > in my office.
> >
> > I went to the website and grabbed the two latest versions:
> > scipy = scipy-0.5.0.win32-py2.4.exe
> > numpy = numpy-1.0b5.win32-py2.4.exe
> >
> >
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Numpy-discussion mailing list
> Numpy-discussion@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread James Graham
Ryan Krauss wrote:
> I would be glad to try that.  Where do I get the installer for scipy 0.51?

http://prdownloads.sourceforge.net/scipy/scipy-0.5.1.win32-py2.4.exe?download

The SciPy website needs to be updated.

-- 
"Eternity's a terrible thought. I mean, where's it all going to end?"
  -- Tom Stoppard, Rosencrantz and Guildenstern are Dead

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread Ryan Krauss
O.K. I think I am up and running.  I actually installed Entought and
Numpy and Scipy worked together there.  I then upgraded the scipy and
numpy packages.

Is there a compatible matplotlib as well?  I was o.k. with mpl from
enthought until I switched numerix to numpy.  That made mpl unhappy.
I downloaded 0.87.5 but I broke something in the process because now
even switching back to Numeric doesn't make mpl happy.  I may switch
to the mpl list if this keeps giving me problems.

Ryan

On 9/6/06, James Graham <[EMAIL PROTECTED]> wrote:
> Ryan Krauss wrote:
> > I would be glad to try that.  Where do I get the installer for scipy 0.51?
>
> http://prdownloads.sourceforge.net/scipy/scipy-0.5.1.win32-py2.4.exe?download
>
> The SciPy website needs to be updated.
>
> --
> "Eternity's a terrible thought. I mean, where's it all going to end?"
>   -- Tom Stoppard, Rosencrantz and Guildenstern are Dead
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Numpy-discussion mailing list
> Numpy-discussion@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread bryce hendrix




Ryan,

The Enthought 1.0.0 release shipped a pre-release of matplotlib 0.87.3,
svn revision 2478. If you update numpy, you have to update to matching
versions of scipy and matplotlib. If you are using binary releases,
guessing which version of each is needed is difficult unless builders
of the binaries specify exactly which version of numpy was used. 

If you're comfortable building these packages yourself, the simple
solution is to download the latest numpy, install it over the existing
numpy, get the latest scipy & matplot lib sources, build them and
install them over the existing packages.

Bryce

Ryan Krauss wrote:

  O.K. I think I am up and running.  I actually installed Entought and
Numpy and Scipy worked together there.  I then upgraded the scipy and
numpy packages.

Is there a compatible matplotlib as well?  I was o.k. with mpl from
enthought until I switched numerix to numpy.  That made mpl unhappy.
I downloaded 0.87.5 but I broke something in the process because now
even switching back to Numeric doesn't make mpl happy.  I may switch
to the mpl list if this keeps giving me problems.

Ryan

On 9/6/06, James Graham <[EMAIL PROTECTED]> wrote:
  
  
Ryan Krauss wrote:


  I would be glad to try that.  Where do I get the installer for scipy 0.51?
  

http://prdownloads.sourceforge.net/scipy/scipy-0.5.1.win32-py2.4.exe?download

The SciPy website needs to be updated.

--
"Eternity's a terrible thought. I mean, where's it all going to end?"
  -- Tom Stoppard, Rosencrantz and Guildenstern are Dead

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


  
  
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

  




-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread Christopher Barker
Ryan Krauss wrote:
> Is there a compatible matplotlib as well?  I was o.k. with mpl from
> enthought until I switched numerix to numpy.  That made mpl unhappy.
> I downloaded 0.87.5 but I broke something in the process because now
> even switching back to Numeric doesn't make mpl happy.

There was an error with the first MPL 0.87.5 builds uploaded. See the 
MPL list for more info, but these builds should work:

http://euclid.uits.iupui.edu/mplfiles/

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/5/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
Matthew Brett wrote:> Hi, This is a result of PyArray_FromAny changing when object arrays are>> explicitly requested (which they are in this case --- although behind>> the scenes).
 Hmm - I think I am hitting a related bug/feature/surprising change in> behavior, which is showing up rather obscurely in a failure of the> scipy.io matlab loading tests:
>> http://projects.scipy.org/scipy/scipy/ticket/258>> Here's the change I wasn't expecting, present with current SVN:>> a = arange(2)
> b = arange(1)> c = array([a, b], dtype=object)> c> ->> array([[0, 1],>[0, 0]], dtype=object)>> On a previous version of numpy (1.02b.dev2975) I get the answer I was expecting:
>> array([[0], [0 1]], dtype=object)>This should now be fixed.  The code was inappropriately not checking fordimensions when object arrays were being constructed.  Now, it raisesthe appropriate error and then interprets it correctly using the extra
object creation code.Users of scipy 0.5.1 will only have to upgrade NumPy to get the fix (theSciPy install won't have to be re-built).-TravisWhere is array at this point? I would like to review the documented behaviour and make modifications to the document string if required. What about Robert's idea of a separate constructor for object arrays? Is it something we could introduce on top of the current array constructor? I realize that if we restrict the current array constructor there might be compatibility problems with Numeric code, but introducing something like oarray as a shorthand for object arrays might incourage it's use. Robert also said that Numarray dealt with object arrays as a separate issue and I wonder what they did that we should think about.
Chuck
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.fftpack: axis=None ?

2006-09-06 Thread Travis Oliphant
PGM wrote:
> Folks,
> I was playing around the numpy.fftpack when I ran into the problem below:
> it seems that axis=None is not valid with fft. Is there a reason for that ?
Not really, other than history and the fact that sub-packages of NumPy 
will often define their own behavior. 

Perhaps we could implement it, but would this create more confusion as 
usually when axis=None is accepted then it is the default. 

-Travis


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Travis Oliphant
Charles R Harris wrote:
>
> Where is array at this point?
Basically it supports the old Numeric behavior wherein object array's 
are treated as before *except* for when an error would have occurred 
previously when the "new behavior" kicks in.  Anything that violates 
that is a bug needing to be fixed.

This leaves the new object-array constructor used less often.  It could 
be exported explicitly into an oarray constructor, but I'm not sure 
about the advantages of that approach.   There are benefits to having 
object arrays constructed in the same way as other arrays.  It turns out 
many people actually like that feature of Numeric, which is the reason I 
didn't go the route of numarray which pulled object arrays out.

At this point, however, object arrays can even be part of records and so 
need to be an integral part of the data-type description.   Pulling that 
out is not going to happen.  A more intelligent object-array 
constructor, however, may be a useful tool.

-Travis





-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy that is compatible with Scipy windows installer version

2006-09-06 Thread Ryan Krauss
Thanks Chris, that worked great.

Ryan

On 9/6/06, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Ryan Krauss wrote:
> > Is there a compatible matplotlib as well?  I was o.k. with mpl from
> > enthought until I switched numerix to numpy.  That made mpl unhappy.
> > I downloaded 0.87.5 but I broke something in the process because now
> > even switching back to Numeric doesn't make mpl happy.
>
> There was an error with the first MPL 0.87.5 builds uploaded. See the
> MPL list for more info, but these builds should work:
>
> http://euclid.uits.iupui.edu/mplfiles/
>
> -Chris
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> NOAA/OR&R/HAZMAT (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> [EMAIL PROTECTED]
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Numpy-discussion mailing list
> Numpy-discussion@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


[Numpy-discussion] f2py with xmingw

2006-09-06 Thread Flavio Coelho
Hi,I have a module that uses a Fortran extension which I would like to compile for windows with f2py. I wonder If I could do this from Linux using xmingw. Has anyone tried this?thanks,
-- Flávio Codeço Coelhoregistered Linux user # 386432---"Laws are like sausages. It's better not to see them being made."Otto von Bismark
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/6/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
Charles R Harris wrote:>> Where is array at this point?Basically it supports the old Numeric behavior wherein object array'sare treated as before *except* for when an error would have occurredpreviously when the "new behavior" kicks in.  Anything that violates
that is a bug needing to be fixed.This leaves the new object-array constructor used less often.  It couldbe exported explicitly into an oarray constructor, but I'm not sureabout the advantages of that approach.   There are benefits to having
object arrays constructed in the same way as other arrays.  It turns outmany people actually like that feature of Numeric, which is the reason Ididn't go the route of numarray which pulled object arrays out.
At this point, however, object arrays can even be part of records and soneed to be an integral part of the data-type description.   Pulling thatout is not going to happen.  A more intelligent object-arrayconstructor, however, may be a useful tool.
OK. I do have a couple of questions. Let me insert the docs for array and asarray :    """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0)    Return an array from object with the specified date-type.
    Inputs:  object - an array, any object exposing the array interface, any    object whose __array__ method returns an array, or any    (nested) sequence.  dtype  - The desired data-type for the array.  If not given, then
    the type will be determined as the minimum type required    to hold the objects in the sequence.  This argument can only    be used to 'upcast' the array.  For downcasting, use the
    .astype(t) method.  copy   - If true, then force a copy.  Otherwise a copy will only occur    if __array__ returns a copy, obj is a nested sequence, or    a copy is needed to satisfy any of the other requirements
  order  - Specify the order of the array.  If order is 'C', then the    array will be in C-contiguous order (last-index varies the    fastest).  If order is 'FORTRAN', then the returned array
    will be in Fortran-contiguous order (first-index varies the    fastest).  If order is None, then the returned array may    be in either C-, or Fortran-contiguous order or even
    discontiguous.  subok  - If True, then sub-classes will be passed-through, otherwise    the returned array will be forced to be a base-class array  ndmin  - Specifies the minimum number of dimensions that the resulting
    array should have.  1's will be pre-pended to the shape as    needed to meet this requirement.    """)asarray(a, dtype=None, order=None)    Returns a as an array.
    Unlike array(), no copy is performed if a is already an array. Subclasses    are converted to base class ndarray.1) Is it true that array doesn't always return a copy except by default? asarray says it contrasts with array in this regard. Maybe copy=0 should be deprecated.
2) Is asarray is basically array with copy=0?3) Is asanyarray basically array with copy=0 and subok=1?4) Is there some sort of precedence table for conversions? To me it looks like the most deeply nested lists are converted to arrays first, numeric if they contain all numeric types, object otherwise. I assume the algorithm then ascends up through the hierarchy like traversing a binary tree in postorder?
5) All nesting must be to the same depth and the deepest nested items must have the same length.6) How is the difference between lists and "lists" determined, i.e.,
In [3]: array([list([1,2,3]),list([1,2])], dtype = object)Out[3]: array([[1, 2, 3], [1, 2]], dtype=object)
In [8]: array([array([1,2,3]),array([1,2])], dtype = object)
Out[8]: array([[1 2 3], [1 2]], dtype=object)
In [9]: array([1,2,3],[1,2]], dtype = object)
   File "", line 1 array([1,2,3],[1,2]], dtype = object)
    ^
SyntaxError: invalid syntaxIs the difference that list(...) and array(...) are passed as functions (lazy evaluation), but a list is just a list?Sorry to be asking all these questions, but I would like to try making the documentation be a bit of a reference. I am sure I will have more questions ;)
-TravisChuck 
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/6/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
On 9/6/06, Travis Oliphant <
[EMAIL PROTECTED]> wrote:
Charles R Harris wrote:>> Where is array at this point?Basically it supports the old Numeric behavior wherein object array'sare treated as before *except* for when an error would have occurredpreviously when the "new behavior" kicks in.  Anything that violates
that is a bug needing to be fixed.This leaves the new object-array constructor used less often.  It couldbe exported explicitly into an oarray constructor, but I'm not sureabout the advantages of that approach.   There are benefits to having
object arrays constructed in the same way as other arrays.  It turns outmany people actually like that feature of Numeric, which is the reason Ididn't go the route of numarray which pulled object arrays out.

At this point, however, object arrays can even be part of records and soneed to be an integral part of the data-type description.   Pulling thatout is not going to happen.  A more intelligent object-array
constructor, however, may be a useful tool.
OK. I do have a couple of questions. Let me insert the docs for array and asarray :    """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0)
    Return an array from object with the specified date-type.
    Inputs:  object - an array, any object exposing the array interface, any    object whose __array__ method returns an array, or any    (nested) sequence.  dtype  - The desired data-type for the array.  If not given, then
    the type will be determined as the minimum type required    to hold the objects in the sequence.  This argument can only    be used to 'upcast' the array.  For downcasting, use the
    .astype(t) method.  copy   - If true, then force a copy.  Otherwise a copy will only occur    if __array__ returns a copy, obj is a nested sequence, or    a copy is needed to satisfy any of the other requirements
  order  - Specify the order of the array.  If order is 'C', then the    array will be in C-contiguous order (last-index varies the    fastest).  If order is 'FORTRAN', then the returned array
    will be in Fortran-contiguous order (first-index varies the    fastest).  If order is None, then the returned array may    be in either C-, or Fortran-contiguous order or even
    discontiguous.  subok  - If True, then sub-classes will be passed-through, otherwise    the returned array will be forced to be a base-class array  ndmin  - Specifies the minimum number of dimensions that the resulting
    array should have.  1's will be pre-pended to the shape as    needed to meet this requirement.    """)asarray(a, dtype=None, order=None)    Returns a as an array.
    Unlike array(), no copy is performed if a is already an array. Subclasses    are converted to base class ndarray.1) Is it true that array doesn't always return a copy except by default? asarray says it contrasts with array in this regard. Maybe copy=0 should be deprecated.
2) Is asarray is basically array with copy=0?3) Is asanyarray basically array with copy=0 and subok=1?4) Is there some sort of precedence table for conversions? To me it looks like the most deeply nested lists are converted to arrays first, numeric if they contain all numeric types, object otherwise. I assume the algorithm then ascends up through the hierarchy like traversing a binary tree in postorder?
5) All nesting must be to the same depth and the deepest nested items must have the same length.6) How is the difference between lists and "lists" determined, i.e.,

In [3]: array([list([1,2,3]),list([1,2])], dtype = object)Out[3]: array([[1, 2, 3], [1, 2]], dtype=object)

In [8]: array([array([1,2,3]),array([1,2])], dtype = object)

Out[8]: array([[1 2 3], [1 2]], dtype=object)

In [9]: array([1,2,3],[1,2]], dtype = object)

   File "", line 1 array([1,2,3],[1,2]], dtype = object)
    ^

SyntaxError: invalid syntaxIs the difference that list(...) and array(...) are passed as functions (lazy evaluation), but a list is just a list?Sorry to be asking all these questions, but I would like to try making the documentation be a bit of a reference. I am sure I will have more questions ;)
-TravisAnd, voila, ragged arrays:
In [9]: a = array([array([1,2,3]),array([1,2])], dtype = object)
In [10]: a*2Out[10]: array([[2 4 6], [2 4]], dtype=object)
In [11]: a + aOut[11]: array([[2 4 6], [2 4]], dtype=object)
Chuck 
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://se

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread A. M. Archibald
On 06/09/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
> On 9/6/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
>
> >   order  - Specify the order of the array.  If order is 'C', then the
> > array will be in C-contiguous order (last-index varies the
> > fastest).  If order is 'FORTRAN', then the returned array
> > will be in Fortran-contiguous order (first-index varies
> the
> > fastest).  If order is None, then the returned array may
> > be in either C-, or Fortran-contiguous order or even
> > discontiguous.

This one's a bit complicated. If array() is passed a list of lists,
there are two different orders that are relevant - the output order of
the array, and the order used to interpret the input. I suppose that
if L is a lost of lists, array(L)[2,3]==L[2][3], that is, in some
sense the arrays are always logically C-ordered even if the underlying
representation is different. Does it make sense to specify this
somewhere in the docstring? At least it would be good to make it clear
that the order parameter affects only the underlying storage format,
and not the indexing of the array.

A. M. Archibald

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Travis Oliphant
Charles R Harris wrote:
> On 9/6/06, *Charles R Harris* <[EMAIL PROTECTED] 
> > wrote:
>
>
>
> On 9/6/06, *Travis Oliphant* < [EMAIL PROTECTED]
> > wrote:
>
> Charles R Harris wrote:
> >
> > Where is array at this point?
> Basically it supports the old Numeric behavior wherein object
> array's
> are treated as before *except* for when an error would have
> occurred
> previously when the "new behavior" kicks in.  Anything that
> violates
> that is a bug needing to be fixed.
>
> This leaves the new object-array constructor used less
> often.  It could
> be exported explicitly into an oarray constructor, but I'm not
> sure
> about the advantages of that approach.   There are benefits to
> having
> object arrays constructed in the same way as other arrays.  It
> turns out
> many people actually like that feature of Numeric, which is
> the reason I
> didn't go the route of numarray which pulled object arrays out.
>
> At this point, however, object arrays can even be part of
> records and so
> need to be an integral part of the data-type description.  
> Pulling that
> out is not going to happen.  A more intelligent object-array
> constructor, however, may be a useful tool. 
>
>
> OK. I do have a couple of questions. Let me insert the docs for
> array and asarray :
>
> """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0)
>
> Return an array from object with the specified date-type.
>
> Inputs:
>   object - an array, any object exposing the array interface, any
> object whose __array__ method returns an array, or any
> (nested) sequence.
>   dtype  - The desired data-type for the array.  If not given,
> then
> the type will be determined as the minimum type
> required
> to hold the objects in the sequence.  This
> argument can only
> be used to 'upcast' the array.  For downcasting,
> use the
> .astype(t) method.
>   copy   - If true, then force a copy.  Otherwise a copy will
> only occur
> if __array__ returns a copy, obj is a nested
> sequence, or
> a copy is needed to satisfy any of the other
> requirements
>   order  - Specify the order of the array.  If order is 'C',
> then the
> array will be in C-contiguous order (last-index
> varies the
> fastest).  If order is 'FORTRAN', then the
> returned array
> will be in Fortran-contiguous order (first-index
> varies the
> fastest).  If order is None, then the returned
> array may
> be in either C-, or Fortran-contiguous order or even
> discontiguous.
>   subok  - If True, then sub-classes will be passed-through,
> otherwise
> the returned array will be forced to be a
> base-class array
>   ndmin  - Specifies the minimum number of dimensions that the
> resulting
> array should have.  1's will be pre-pended to the
> shape as
> needed to meet this requirement.
>
> """)
>
> asarray(a, dtype=None, order=None)
> Returns a as an array.
>
> Unlike array(), no copy is performed if a is already an array.
> Subclasses
> are converted to base class ndarray.
>
> 1) Is it true that array doesn't always return a copy except by
> default? asarray says it contrasts with array in this regard.
> Maybe copy=0 should be deprecated.
>
> 2) Is asarray is basically array with copy=0?
>
> 3) Is asanyarray basically array with copy=0 and subok=1?
>
> 4) Is there some sort of precedence table for conversions? To me
> it looks like the most deeply nested lists are converted to arrays
> first, numeric if they contain all numeric types, object
> otherwise. I assume the algorithm then ascends up through the
> hierarchy like traversing a binary tree in postorder?
>
> 5) All nesting must be to the same depth and the deepest nested
> items must have the same length.
>
> 6) How is the difference between lists and "lists" determined, i.e.,
>
> In [3]: array([list([1,2,3]),list([1,2])], dtype = object)
> Out[3]: array([[1, 2, 3], [1, 2]], dtype=object)
>
> In [8]: array([array([1,2,3]),array([1,2])], dtype = object)
> Out[8]: array([[1 2 3], [1 2]], dtype=object)
>
>
> In [9]: array([1,2,3],[1,2]], dtype = object)
> 
>File "", line 1
>  array([1,2,3],[1,2]]