Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Python/Numeric users be aware!

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


benyang22 at gmail

Oct 29, 2008, 10:53 AM

Post #1 of 6 (747 views)
Permalink
Python/Numeric users be aware!

Maybe it has been reported somewhere, but it is a big surprise to me.

# Try the following:
import Numeric
a = Numeric.ones(10)
a[5:] = -1
print a

It works correctly on 32-bit linux machines and on 32-bit Windows XP:
[. 1 1 1 1 1 -1 -1 -1 -1 -1]

It is totally screwed up on 64-bit linux machines:
[1 1 1 1 1 1 1 1 1 1]

# The following works correctly on both 32-bit and 64-bit machines
(notice the comma):
a[5:,] *= -1

The Python version is 2.5.1, and Numeric is the latest version 24.2.
--
http://mail.python.org/mailman/listinfo/python-list


carl at never

Oct 29, 2008, 11:09 AM

Post #2 of 6 (707 views)
Permalink
Re: Python/Numeric users be aware! [In reply to]

Confirmed

Benyang wrote:
> Maybe it has been reported somewhere, but it is a big surprise to me.
>
> # Try the following:
> import Numeric
> a = Numeric.ones(10)
> a[5:] = -1
> print a
>
> It works correctly on 32-bit linux machines and on 32-bit Windows XP:
> [. 1 1 1 1 1 -1 -1 -1 -1 -1]
>
> It is totally screwed up on 64-bit linux machines:
> [1 1 1 1 1 1 1 1 1 1]
>
> # The following works correctly on both 32-bit and 64-bit machines
> (notice the comma):
> a[5:,] *= -1
>
> The Python version is 2.5.1, and Numeric is the latest version 24.2.
--
http://mail.python.org/mailman/listinfo/python-list


malaclypse2 at gmail

Oct 29, 2008, 11:20 AM

Post #3 of 6 (709 views)
Permalink
Re: Python/Numeric users be aware! [In reply to]

On Wed, Oct 29, 2008 at 1:53 PM, Benyang <benyang22 [at] gmail> wrote:
> The Python version is 2.5.1, and Numeric is the latest version 24.2.

While 24.2 is the latest version of Numeric, it's also three years old
and no longer supported. From http://numpy.scipy.org/ - "Numeric was
the first arrayobject built for Python. It has been quite successful
and is used in a wide variety of settings and applications.
Maintenance has ceased for Numeric, and users should transisition to
NumPy as quickly as possible."

So, you are unlikely to find anyone to do bug fixes on Numeric.

--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list


kirk at athena

Oct 29, 2008, 11:30 AM

Post #4 of 6 (710 views)
Permalink
Re: Python/Numeric users be aware! [In reply to]

At 2008-10-29T17:53:43Z, Benyang <benyang22 [at] gmail> writes:

> It is totally screwed up on 64-bit linux machines:
> [1 1 1 1 1 1 1 1 1 1]

And on 64-bit FreeBSD machines.
--
Kirk Strauser
The Day Companies
--
http://mail.python.org/mailman/listinfo/python-list


benyang22 at gmail

Oct 29, 2008, 12:46 PM

Post #5 of 6 (695 views)
Permalink
Re: Python/Numeric users be aware! [In reply to]

I also found that the a[5:] problem is Python version dependent.

On a 64-bit linux, of the following combinations I have tried, only
the first one has the problem. The other two are ok.
* Python 2.5.1 and Numeric 24.2
* Python 2.4.5 and Numeric 24.2
* Python 2.3.7 and Numeric 24.2

On Oct 29, 10:53 am, Benyang <benyan...@gmail.com> wrote:
> Maybe it has been reported somewhere, but it is a big surprise to me.
>
> # Try the following:
> import Numeric
> a = Numeric.ones(10)
> a[5:] = -1
> print a
>
> It works correctly on 32-bit linux machines and on 32-bit Windows XP:
> [. 1  1  1  1  1 -1 -1 -1 -1 -1]
>
> It is totally screwed up on 64-bit linux machines:
> [1 1 1 1 1 1 1 1 1 1]
>
> # The following works correctly on both 32-bit and 64-bit machines
> (notice the comma):
> a[5:,] *= -1
>
> The Python version is 2.5.1, and Numeric is the latest version 24.2.

--
http://mail.python.org/mailman/listinfo/python-list


robert.kern at gmail

Oct 29, 2008, 1:35 PM

Post #6 of 6 (706 views)
Permalink
Re: Python/Numeric users be aware! [In reply to]

Benyang Tang wrote:
> I also found that the a[5:] problem is Python version dependent.
>
> On a 64-bit linux, of the following combinations I have tried, only
> the first one has the problem. The other two are ok.
> * Python 2.5.1 and Numeric 24.2
> * Python 2.4.5 and Numeric 24.2
> * Python 2.3.7 and Numeric 24.2

Python 2.5.1 introduced the use of Py_ssize_t for indices. Previously, those
functions took C ints. Numeric 24.2 predates Python 2.5 substantially.

--
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

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.