[SciPy-user] Problem with numeric array bounds

Robert Kern robert.kern@gmail....
Mon Oct 27 12:38:18 CDT 2008


On Mon, Oct 27, 2008 at 12:11, Ramon Crehuet <rcsqtc@iiqab.csic.es> wrote:
> Dear all,
> I know Numeric is no longer supported, but we are using an application
> (nMoldyn) that uses it, and we are encoutering an unusual problem.
> I am using the Numeric 23.8.2 version to create arrays, but there is
> something wrong when it comes to create a subarray:
> ----------------------------------------------------------------------
> Python 2.5 (r25:51908, Jan 10 2008, 18:01:52)
> [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import Numeric
>>>> a=Numeric.array([7,5,1])
>>>> a
> array([7, 5, 1])
>>>> a[0:]
> array([7, 5])
> ----------------------------------------------------------------------
>
> The subarray ends at the penultimate element when using ':' On
> the other hand, there is no problem when defining sublists. Can be
> something wrong with python and/or Numeric installation?

Try Numeric 24.2. On my machine, it gives the correct results:

>>> import Numeric
>>> a = Numeric.array([7,5,1])
>>> a[0:]
array([7, 5, 1])

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list