i have a simple array with floating values
>>> print a
array([ 0. , 0.2, 0.4, 0.6, 0.8])
what i need to do is change each index into another
dimension with 3 indices. hmm, kind of confusing, an
example will explain better
>>> b = array(zip(a,a,a))
>>> print b
array([[ 0. , 0. , 0. ],
[ 0.2, 0.2, 0.2],
[ 0.4, 0.4, 0.4],
[ 0.6, 0.6, 0.6],
[ 0.8, 0.8, 0.8]])
ok, this does the job, but once i start using large
arrays, the back-n-forth conversion between arrays and
python lists is costing me quite a bit. is there a way
i can reshape the array this way without the call to
python's 'zip'? (no, 'map' doesn't count either)
i've tried much fooling with NewAxis, resize, and friends.
but either i haven't stumbled upon the correct combination
or i'm not trying the correct tools. i'd like to keep this
as quick as possible, so hopefully it can be done without
anything too elaborate.
(doh, sorry for the previous distutils related post...
hit the wrong mailing list)
When attempting to install Numeric 17.0 with Python 1.5.2 and Distutils 1.0
on Red Hat 7.0, I get the following error after issuing the command 'python
Traceback (innermost last):
File "setup.py", line 15, in ?
vs = map(string.atoi, v.groups())
AttributeError: 'None' object has no attribute 'groups'
This error occurs regardless of whether or not I am root. I have also tried
uninstalling the Red Hat Python packages and installing all from source, but I
get the same error.
Any help would be appreciated.
I needed last Saturday a function which returns the greatest/smallest
element of a NumPy array. I seeked through the documentation and found the
argmax/argmin functions. However, they must be called recursively to find
the greatest(smallest) element of a multidimendional array. As I needed to
process a BIG dataset of multidimensional arrays, I wrote a function in C
which returns as a NumPy array shaped (2,) the [smallest one,biggest one]
elements in an arbitrarily shaped NumPy array. It is pure C and works for
multidimensional arrays. The return typecode is the same of the input
array (except with complex numbers, which compare numbers through their
I can make this function available to general public by means of my WEB
page or my starship account as a module. However, I wonder:
a) Is this a wheel already invented some 40,000 years ago? May be I missed
something in the manual?
b) If the answer to the previous question is NO, would you (main
developers) be interested in making it available as one of the "general
purpose" NumPy functions? It is quite general-purpose, indeed. I have
needed it five times or so in the last two years...
Looking after your comments.
Jon Saenz. | Tfno: +34 946012470
Depto. Fisica Aplicada II | Fax: +34 944648500
Facultad de Ciencias. \\ Universidad del Pais Vasco \\
Apdo. 644 \\ 48080 - Bilbao \\ SPAIN
Numeric Python 17.3.0 is available in source form at
This is the last planned release in the 17 family. Binary versions will
appear later -- developers, please help.
Release 18 will require Python 2.1. Several of the new features in Python
2.1 are specifically meant to enable improvements in Numeric and we are
going to try to take advantage of them.
Paul F. Dubois
Program for Climate Model Diagnosis and Intercomparison
Lawrence Livermore National Laboratory
This is to announce the release of version 1.5 of Gnuplot.py.
Gnuplot.py is a Python  package that allows you to create graphs
from within Python using the gnuplot  plotting program.
Gnuplot.py can be obtained from
Prerequisites (see footnotes):
the Python interpreter 
the Python Numeric module 
the gnuplot program 
Some ways this package can be used:
1. Interactive data processing: Use Python's excellent Numeric package
to create and manipulate arrays of numbers, and use Gnuplot.py to
visualize the results.
2. Web graphics: write CGI scripts in Python that use gnuplot to
output plots in GIF format and return them to the client.
3. Glue for numerical applications (this is my favorite): wrap your
C++/C/Fortran subroutines so that they are callable from Python,
then you can perform numerical computations interactively from
scripts or from the command line and use Gnuplot.py to plot the
output on the fly.
4. Compute a series of datasets in Python and plot them one after the
other using Gnuplot.py to produce a crude animation.
New features in this version:
+ Added distutils support.
+ Broke up the module a bit for better maintainability. The most
commonly-used facilities are still available through "import
Gnuplot", but some specialized things have been moved to separate
modules, in particular funcutils.py and PlotItems.py.
+ funcutils.tabulate_function() can be used to evaluate a function
on a 1-D or 2-D grid of points (this replaces grid_function,
which only worked with 2-D grids).
+ Added two helper functions, funcutils.compute_Data and
funcutils.compute_GridData, which compute a function's values on
a set of points and package the results into a PlotItem.
+ GridFunc is no longer an independent class; it is now a factory
function that returns a GridData. GridFunc is deprecated in
favor of funcutils.compute_GridData.
+ Changed set_option to work from a table, so that it doesn't need
to be overloaded so often.
+ Implemented test_persist for each platform to make it easier for
users to determine whether the `-persist' option is supported.
+ Added a prefer_persist option to serve as the default `persist'
+ Following a suggestion by Jannie Hofmeyr, use "from os import
popen" for Python 2.0 under Windows. I don't use Windows, so let
me know how this works.
+ Added support for the `axes' and `smooth' options of the `plot'
+ Reworked the comment strings in an effort to make them work
nicely with happydoc.
Features already present in older versions:
+ Two and three-dimensional plots.
+ Plot data from memory, from a file, or from an expression.
+ Support for multiple simultaneous gnuplot sessions.
+ Can pass arbitrary commands to the gnuplot program.
+ Object oriented, extensible design with several built-in types
of plot items.
+ Portable and easy to install (nothing to compile except on
+ Support for MS Windows, using the `pgnuplot.exe' program.
+ Support for sending data to gnuplot as `inline' or `binary' data.
These are optimizations that also remove the need for temporary
files. Temporary files are still the default.
 Python <http://www.python.org> is an excellent object-oriented
scripting/rapid development language that is also especially good
at gluing programs together.
 gnuplot <http://www.gnuplot.org/> is a free, popular, very
portable plotting program with a command-line interface. It can
make 2-d and 3-d plots and can output to myriad printers and
 The Numeric Python extension <http://numpy.sourceforge.net/> is a
Python module that adds fast and convenient array manipulations to
the Python language.
some time ago I registered the domain numpy.org with the intention of
donating it to the group
just thought about it again today, and realized I could easily redirect it,
so my question is:
o does anyone object to my doing that?
o where should it point, here?
if someone feels strongly that I should transfer ownership of the domain to
someone more central to development, etc., I'll be happy to do that -
otherwise I'm happy just redirecting and renewing it as it comes up, or at
some point setting up real hosting of the domain somewhere (sourceforge?)
John A. Turner, Ph.D. Senior Research Associate
Blue Sky Studios, 44 S. Broadway, White Plains, NY 10601
http://www.blueskystudios.com/ (914) 259-6319
On Sun, Jan 21, 2001 at 12:36:37PM -0800, Greg Stein wrote:
> FYI about what? I'm not sure that I see the point here.
> Are you trying to say that ActiveState can provide tools for packaging?
> Maybe that we can get NumPy packaged for people?
This one, I believe. HoumanG has been working on PyPM (like PPM for Python)
for which he is creating appropriate setup.py scripts for packages such as
I wrote a new setup.py script for NumPy a week ago. The script I wrote
builds the RANLIB and the LALITE as part of the core NumPy; and the binary
distribution of NumPy built with my script also installs the RANLIB and
If the question is that Distutils supports a source tree structure like the
one NumPy has, the question is no. However, I made a patch (for Distutils)
and submitted to SourceForge which allows the source tree to be spread in
more than one directory. A copy of the patch is in the attachment.
I've got Python 20 and numerical python installed and running, i.e., I can
run python scripts and call import module Numerical and use arrays,etc.
I've also been successful at calling python scripts from C/C++ code (MSVC++
6.0) - Py_Initialize(), Py_BuildValue() etc. and building the de-bug
version of python20.dll (python20_d.dll) so I can debug-step through the
However, I can't seem to be able to call numpy functions from C/C++ -
PyArray_FromDims(), etc. My code will compile and link but, at runtime, I
get an exception error.
It seems that either I need to create a numpy.dll that will live in
winnt/system32 or somehow need to modify python20.dll to include the numpy
How do I do that?