473,386 Members | 1,830 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.

Numpy-f2py troubles

Hello NG,

I am using the latest Numpy release 1.0rc2 which includes F2PY. I
have switched to Python 2.5 so this is the only alternative I have
(IIUC). With Python 2.4, I was able to build a very simple fortran
extension without problems.

My extension contains 4 subroutines that scan a file and do simple operations.
Now, attempting to run the second subroutine as:

dprops, dwgnames, dunits = readsmspec.readsmspec(smspec, dimens)

Prompt a ValueError from Python:

File "D:\MyProjects\Carolina\MainPanel.py", line 894, in ReadSMSPECFile
dprops, dwgnames, dunits = readsmspec.readsmspec(smspec, dimens)
ValueError: data type must provide an itemsize

?!? I have never seen anything like that and googling around didn't
give me any answer. The function accepts two inputs:

- smspec: a filename, maximum 1000 characters long
- dimens: an integer

and returns 3 array of chars, each of them with size (8, dimens). Does
anyone know what I may be doing wrong?

Thank you very much for every pointer.
--
Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
Oct 17 '06 #1
1 2789
Hi Andrea,

you should post this to the numpy list:
nu**************@lists.sourceforge.net

Cheers! Bernhard

Andrea Gavana schrieb:
Hello NG,

I am using the latest Numpy release 1.0rc2 which includes F2PY. I
have switched to Python 2.5 so this is the only alternative I have
(IIUC). With Python 2.4, I was able to build a very simple fortran
extension without problems.

My extension contains 4 subroutines that scan a file and do simple operations.
Now, attempting to run the second subroutine as:

dprops, dwgnames, dunits = readsmspec.readsmspec(smspec, dimens)

Prompt a ValueError from Python:

File "D:\MyProjects\Carolina\MainPanel.py", line 894, in ReadSMSPECFile
dprops, dwgnames, dunits = readsmspec.readsmspec(smspec, dimens)
ValueError: data type must provide an itemsize

?!? I have never seen anything like that and googling around didn't
give me any answer. The function accepts two inputs:

- smspec: a filename, maximum 1000 characters long
- dimens: an integer

and returns 3 array of chars, each of them with size (8, dimens). Does
anyone know what I may be doing wrong?

Thank you very much for every pointer.
--
Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
Oct 18 '06 #2

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

Similar topics

13
by: Gary Wessle | last post by:
Hi I am trying to install NumPy in my debian/testing linux 2.6.15-1-686. with no numpy for debian/testing, I am left alone, since the experimental version available by debian will result in a...
3
by: Iljya | last post by:
Hello, I need to pickle the type numpy.float32 but encounter an error when I try to do so. I am able to pickle the array itself, it is specifically the type that I cannot pickle. I am using:...
0
by: robert | last post by:
just a note - some speed comparisons : 0.60627370238398726 0.42836673376223189 0.36965815487747022 0.016557970357098384 0.15692469294117473 0.01951756438393204
2
by: robert | last post by:
in Gnuplot (Gnuplot.utils) the input array will be converted to a Numeric float array as shown below. When I insert a numpy array into Gnuplot like that below, numbers 7.44 are cast to 7.0 Why is...
2
by: Chris Smith | last post by:
Howdy, I'm a college student and for one of we are writing programs to numerically compute the parameters of antenna arrays. I decided to use Python to code up my programs. Up to now I haven't...
5
by: robert | last post by:
Turning algs for old NumPy modules into numpy code I suffer from this: Upon further processing of returns of numpy calculations, lots of data in an apps object tree will become elementary numpy...
3
by: Duncan Smith | last post by:
Hello, Since moving to numpy I've had a few problems with my existing code. It basically revolves around the numpy scalar types. e.g. ------------------------------------------------ array(,...
5
by: Marc Oldenhof | last post by:
Hello all, I'm pretty new to Python, but use it a lot lately. I'm getting a crazy error trying to do operations on a string list after importing numpy. Minimal example: Python 2.5.1...
3
by: Sean Davis | last post by:
I have a set of numpy arrays which I would like to save to a gzip file. Here is an example without gzip: b=numpy.ones(1000000,dtype=numpy.uint8) a=numpy.zeros(1000000,dtype=numpy.uint8) fd =...
2
by: Travis Oliphant | last post by:
I wanted to point anybody interested to a blog post that describes a useful pattern for having a NumPy array that points to the memory created by a different memory manager than the standard one...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.