473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.
Oct 29 '08 #1
5 1052
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.
Oct 29 '08 #2
On Wed, Oct 29, 2008 at 1:53 PM, Benyang <be*******@gmail.comwrote:
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
Oct 29 '08 #3
At 2008-10-29T17:53:43Z, Benyang <be*******@gmail.comwrites:
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
Oct 29 '08 #4
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.comwrote:
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.
Oct 29 '08 #5
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

Oct 29 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Rowe | last post by:
Does numarray-0.5.win32-py2.2.exe work with Python 2.3? If not, is there a version that will? Tia, Tim
32
by: David | last post by:
Hi I'm trying to teach myself python and so far to good, but I'm having a bit of trouble getting a function to work the way I think it should work. Right now I'm taking a simple program I wrote in...
5
by: C. Barnes | last post by:
Hi, I'm in the process of writing a Python linear algebra module. The current targeted interface is: http://oregonstate.edu/~barnesc/temp/linalg/ The interface was originally based on...
29
by: Frank Millman | last post by:
Hi all I am writing a multi-user accounting/business system. Data is stored in a database (PostgreSQL on Linux, SQL Server on Windows). I have written a Python program to run on the client,...
19
by: Nicolas Pernetty | last post by:
Hello, I'm looking for any work/paper/ressource about continuous system simulation using Python or any similar object oriented languages (or even UML theory !). I'm aware of SimPy for...
96
by: Gustav Hållberg | last post by:
I tried finding a discussion around adding the possibility to have optional underscores inside numbers in Python. This is a popular option available in several "competing" scripting langauges, that...
135
by: robinsiebler | last post by:
I've never had any call to use floating point numbers and now that I want to, I can't! *** Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) on win32. *** 0.29999999999999999 0.29999999999999999
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.