Re: Texas Python Regional Unconference Reminders

2008-10-01 Thread Travis E. Oliphant
yourself to the Attendees page if you're able to make it. Also, if you're planning to attend, please send me the following information (to [EMAIL PROTECTED]) so I can request wireless access for you during the meeting: - Full Name - Phone or email - Address - Affiliation

Re: numpy migration (also posted to numpy-discussion)

2007-04-23 Thread Travis E. Oliphant
Duncan Smith wrote: > 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. > You will probably get more help on the numpy discussion list: [EMAIL PROTECTED] You are encountering problems because numpy sca

ANN: NumPy 1.0.2

2007-04-03 Thread Travis E. Oliphant
We are pleased to announce the release of NumPy 1.0.2 NumPy is a Python extension that provides a general-purpose multi-dimensional array that can act as a container of arbitrary raw-data formats (including bools, integers, floats, complex, Python objects, string, unicode, and general C-struct

Re: numpy or _numpy or Numeric?

2007-01-24 Thread Travis E. Oliphant
auditory wrote: >>> While trying to install numpy accroding to its homepage. >>> (http://numpy.scipy.org/numpydoc/numdoc.htm). >>> i am quite confused. >> You are reading old documentation for Numeric and so any installation >> description is how to install the Numeric module (not its newer >> re

Re: numpy or _numpy or Numeric?

2007-01-23 Thread Travis E. Oliphant
auditory wrote: > I am a newbie here > > I am trying to read "space separated floating point data" from file > > I read about csv module by searching this group, > but I couldn't read space separated values with csv. > (which may be matter of course..) > > I also read about numpy.fromfile(file,

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-15 Thread Travis E. Oliphant
oyekomova wrote: > Thanks to everyone for their excellent suggestions. I was able to > acheive the following results with all your suggestions. However, I am > unable to cross file size of 6 million rows. I would appreciate any > helpful suggestions on avoiding memory errors. None of the solutions

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-11 Thread Travis E. Oliphant
oyekomova wrote: > Thanks for your help. I compared the following code in NumPy with the > csvread in Matlab for a very large csv file. Matlab read the file in > 577 seconds. On the other hand, this code below kept running for over 2 > hours. Can this program be made more efficient? FYI - The csv f

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-11 Thread Travis E. Oliphant
oyekomova wrote: > Thanks for your help. I compared the following code in NumPy with the > csvread in Matlab for a very large csv file. Matlab read the file in > 577 seconds. On the other hand, this code below kept running for over 2 > hours. Can this program be made more efficient? FYI - The csv f

Re: Sorting Multidimesional array(newbie)

2006-12-12 Thread Travis E. Oliphant
Tartifola wrote: > Hi, > how can I sort an array like > > array([[5, 2], >[1, 3]]) > > along the first column to obtain > > array([[1, 3], >[5, 2]]) > i.e. keeping track of the ordered couples? > > Thanks, > A Just to add one more solution to this question that works with numpy

Re: concatenating numpy arrays

2006-10-31 Thread Travis E. Oliphant
Rolf Wester wrote: > Hi, > > I want to concatenate two numpy arrays with shape (n1,n2) and (n1,n3) > into a single array with shape (n1,n2+n3). I guess there is an elegant > way to do this but I couldn't figure it out. So any help is very much > appreciated. > Suppose a1.shape is (n1,n2) and

Re: latest numpy & scipy - incompatible ?

2006-10-29 Thread Travis E. Oliphant
robert wrote: > I'm using latest numpy & scipy. What is this problem ? : > import scipy.stats > RuntimeError: module compiled against version 102 of C-API but this > version of numpy is 109 > Traceback (most recent call last): > File "", line 1, in ? > File "C:\PYTHON23\Lib\site-

[ANN] NumPy 1.0 release

2006-10-26 Thread Travis E. Oliphant
We are very pleased to announce the release of NumPy 1.0 available for download at http://www.numpy.org This release is the culmination of over 18 months of effort to allow unification of the Numeric and Numarray communities. NumPy provides the features of both packages as well as comparable

Re: problem with fft periodogram

2006-10-25 Thread Travis E. Oliphant
[EMAIL PROTECTED] wrote: > Hello, > > I am ploting a fft periodogram of my data using a script (found in > internet: http://linuxgazette.net/115/andreasen.html ) that gave me > good results before. There should be a periodicity of >160 in the data > as can be seen by eye. However, this script now

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Travis E. Oliphant
Robin Becker wrote: > Hi, just trying to avoid wheel reinvention. I have need of an unsigned 32 bit > arithmetic type to carry out a checksum operation and wondered if anyone had > already defined such a beast. > > Our current code works with 32 bit cpu's, but is failing with 64 bit > compariso

Re: numbers to string

2006-10-24 Thread Travis E. Oliphant
David Isaac wrote: y > [116, 114, 121, 32, 116, 104, 105, 115] z=''.join(chr(yi) for yi in y) z > 'try this' > > What is an efficient way to do this if y is much longer? > (A numpy solution is fine.) Here's another numpy solution just for fun: import numpy z = numpy.array(y,dtype=

Re: numpy error

2006-10-23 Thread Travis E. Oliphant
Juergen Kareta wrote: > Hello, > > this is my first try to get wxmpl-1.2.8 running. Therefor I installed: > > python 2.5 > matplotlib-0.87.6.win32-py2.5.exe > numpy-1.0rc3.win32-py2.5.exe > > on WinXP SP2 > > The result is a version mismatch (see below). > > Numpy version 102 seems to be n

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread Travis E. Oliphant
Martin v. Löwis wrote: > [EMAIL PROTECTED] schrieb: >> Anyone ever done this? It looks like Python2.4 won't take a length arg >>> 2 Gig since its not seen as an int. > > What architecture are you on? On a 32-bit architecture, it's likely > impossible to map in 2GiB, anyway (since it likely won't

Re: How to convert this list to string?

2006-10-18 Thread Travis E. Oliphant
Jia Lu wrote: > Hi all > > I have a list like: > list > [1, 2, 3] list[1:] > [2, 3] > > I want to get a string "2 3" > str(list[1:]) > '[2, 3]' > > How can I do that ? > " ".join(str(x) for x in list) -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: switching to numpy and failing, a user story

2006-10-04 Thread Travis E. Oliphant
[EMAIL PROTECTED] wrote: > After using numeric for almost ten years, I decided to attempt to > switch a large codebase (python and C++) to using numpy. Here's are > some comments about how that went. > > - The code to automatically switch python stuff over just kind of > works. But it was a 90% so

Re: Trouble Passing Array of Strings (using Numeric) to C Extension Module

2006-09-20 Thread Travis E. Oliphant
goetzie wrote: > I am using Python 2.4.1 and Numeric 23.8 and running on Windows XP. I > am passing a Numeric array of strings (objects) to a C Extension module > using the following python code: Numeric 23.8 is *very* old and unsupported. Unless you absolutely have to use Numeric (then use 24

Re: Random Drawing Simulation -- performance issue

2006-09-12 Thread Travis E. Oliphant
Brendon Towle wrote: > I need to simulate scenarios like the following: "You have a deck of > 3 orange cards, 5 yellow cards, and 2 blue cards. You draw a card, > replace it, and repeat N times." > Thinking about the problem as drawing sample froms a discrete distribution defined by the popu

Re: [ANN] NumPy 1.0b4 now available

2006-08-29 Thread Travis E. Oliphant
Bruce Who wrote: > Hi, Travis > > I can pack my scripts into an executable with py2exe, but errors occur > once it runs: I suspect you need to force-include the numpy/core/_internal.py file by specifying it in your setup.py file as explained on the py2exe site. That module is only imported by t

[ANN] NumPy 1.0b4 now available

2006-08-26 Thread Travis E. Oliphant
The 4th beta release of NumPy 1.0 has just been made available. NumPy 1.0 represents the culmination of over 18 months of work to unify the Numeric and Numarray array packages into a single best-of-breed array package for Python. NumPy supports all the features of Numeric and Numarray with a he

Re: numpy : argmin in multidimensional arrays

2006-07-06 Thread Travis E. Oliphant
TG wrote: > Hi there. > > I am working with multi-dimensional arrays and I need to get > coordinates of the min value in it. > > using myarray.argmin() returns the index in the flatten array, which is > a first step, but I wonder if it is possible to get the coordinates > directly as an array, ra

Re: reordering elements of a list

2006-06-03 Thread Travis E. Oliphant
greenflame wrote: > I am trying to reorder elements of a list and I am stuck as to what > might be the best way to approach this. I have a (main) list of > elements and another (ordering) list (which is may shorter, but not > longer than the main list) which contains the order in which I want the

Re: Looking for triangulator/interpolator

2006-05-27 Thread Travis E. Oliphant
Grant Edwards wrote: > On 2006-05-27, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > >> Not that you made a bad choice. I do wonder, how much of your >> difficulty was with the interface to the underlying fitpack >> routines. > > I've no idea. I ha

Re: matplotlib and numpy installation

2006-05-27 Thread Travis E. Oliphant
cesco wrote: > Hi, > > I wanted to install python, numpy and matplotlib on Linux Ubuntu. > I installed python with the following commands > ./configure --enable-unicode=ucs4 > [snip] > running build_ext > building 'matplotlib.backends._ns_backend_agg' extension > gcc options: '-pthread -fno-strict

Re: Looking for triangulator/interpolator

2006-05-27 Thread Travis E. Oliphant
Grant Edwards wrote: > On 2006-05-27, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > >>> I need to interpolate an irregularly spaced set of sampled >>> points: Given a set of x,y,z points, I need to interpolate z >>> values for a much finer x,y gri

Re: Looking for triangulator/interpolator

2006-05-26 Thread Travis E. Oliphant
Grant Edwards wrote: > I need to interpolate an irregularly spaced set of sampled > points: Given a set of x,y,z points, I need to interpolate z > values for a much finer x,y grid. How many x,y,z points do you have? Did you try the fitpack function bisplrep in scipy? It can work well as long as

Re: Scipy: vectorized function does not take scalars as arguments

2006-05-24 Thread Travis E. Oliphant
ago wrote: > Once I vectorize a function it does not acccept scalars anymore. Es > > def f(x): return x*2 > vf = vectorize(f) > print vf(2) > > AttributeError: 'int' object has no attribute 'astype' > > Is this the intended behaviour? > Vectorize handles scalars in recent versions of NumPy. W

ANN: NumPy 0.9.8 released

2006-05-17 Thread Travis E. Oliphant
NumPy 0.9.8 has been released. It can be downloaded from http://numeric.scipy.org The release notes are attached. Best regards, -Travis Oliphant NumPy 0.9.8 is a bug-fix and optimization release with a few new features. The C-API was changed so that extensions compiled against

Re: segmentation fault in scipy?

2006-05-10 Thread Travis E. Oliphant
[EMAIL PROTECTED] wrote: > I'm running operations large arrays of floats, approx 25,000 x 80. > Python (scipy) does not seem to come close to using 4GB of wired mem, > but segments at around a gig. Everything works fine on smaller batches > of data around 10,000 x 80 and uses a max of ~600mb of mem

Re: installing numpy

2006-03-15 Thread Travis E. Oliphant
cesco wrote: > Hi, > > I'm trying to install the numpy library (precisely > numpy-0.9.6-py2.4-linux-i686) on Linux but I encounter several This is a dumb pre-built binary package (useful perhaps because it links against ATLAS already) built using distutils. You don't build it and install it usi

Re: Trouble with numpy-0.9.4 and numpy-0.9.5

2006-03-01 Thread Travis E. Oliphant
drife wrote: > Hello, > > I use the Python Numeric package extensively, and had been an > avid user of the "old" scipy. In my view, both pieces of software > are truly first rate, and have greatly improved my productivity in > the area of scientific analysis. Thus, I was excited to make the > tran

Re: Scientific Computing with NumPy

2006-02-28 Thread Travis E. Oliphant
[EMAIL PROTECTED] wrote: > Terry Reedy wrote: > >>"kpp9c" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >>>Numeric, Numarray, & Numpy... some one stick a screwdriver in my >>>forehead and end the madness that Numeric has become. >> >>>For crying all night! Numpy was Numeric's ni

Re: ANN: Release of NumPy 0.9.5

2006-02-18 Thread Travis E. Oliphant
vinjvinj wrote: > I read some of the earlier threads which essentially said that numpy is > about 3-4 times slower then Numeric for smaller arrays. I'm assuming > that applies only to operations that apply to the whole arrays. > > I was curious how the performance of the following operations would

Re: ANN: Release of NumPy 0.9.5

2006-02-17 Thread Travis E. Oliphant
Thomas Gellekum wrote: > "Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > > >> - Improvements to numpy.distutils > > > Stupid questions: is it really necessary to keep your own copy of > distutils and even install it? What's wrong with the

Re: calculating on matrix indices

2006-02-16 Thread Travis E. Oliphant
Brian Blais wrote: > Hello, > > In my attempt to learn python, migrating from matlab, I have the following > problem. > Here is what I want to do, (with the wrong syntax): > > from numpy import * > > t=arange(0,20,.1) > x=zeros(len(t),'f') > > idx=(t>5) > tau=5 > x[idx]=exp(-t[idx]/tau) # <-

ANN: Release of NumPy 0.9.5

2006-02-16 Thread Travis E. Oliphant
NumPy is the successor to both Numeric and Numarray. It builds from and uses code from both. More information can be found at the following links http://numeric.scipy.org http://www.scipy.org http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103 Highlights of Release:

Re: Scientific Computing with NumPy

2006-02-06 Thread Travis E. Oliphant
Tim Hochberg wrote: > mclaugb wrote: > > > No, Scientific Python is "a collection of Python modules that are useful > for scientific computing" written by Konrad Hinsen. I'm not a user, but > you can find information here: > > http://starship.python.net/~hinsen/ScientificPython/ > > Sci

Re: Scientific Computing with NumPy

2006-02-06 Thread Travis E. Oliphant
mclaugb wrote: > Is Scipy the same thing as ScientificPython? No. They are two separate projects. Scientific Python is still Numeric-only. SciPy 0.3.x is Numeric-based and SciPy 0.4.x is NumPy-based. The developers for NumPy are also the developers for SciPy (for the most part). There is a

Re: writing arrays to binary file

2006-01-25 Thread Travis E. Oliphant
Sheldon wrote: > Hi everyone, > > I have a short program the writes the output data to an acsii file: > > import sys > import os > import string > import gisdata > from Numeric import * > > def latlon(area_id, i, j): > lon_file = "lon_%s.dat" % area_id > flon= open(lon_file, 'wa'

Re: Is there a way to profile underlying C++ code?

2006-01-24 Thread Travis E. Oliphant
Bo Peng wrote: > Dear list, > > I have a C++-SWIG-wrapped python module. The running time for one of the > functions is pretty unpredictable so I would like to profile it. > However, the python profiler does not seem to enter the compiled module > (.so file). Is there a way to profile the C++ f

Re: Possible memory leak?

2006-01-24 Thread Travis E. Oliphant
Tuvas wrote: > I have a function in a program that works something like this. > > def load_pic_data(width,heigth,inpdat, filt=TRUE): > data='' > total=0 > tnum=0 > size=100 > for y in range(0,heigth): > row='' > for x in range

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-21 Thread Travis E. Oliphant
J wrote: > I will just jump in an use NumPy. I hope this one will stick and evolve > into the mother of array packages. > How stable is it ? For now I really just need basic linear algebra. > i.e. matrix multiplication, dot, cross etc > There is a new release coming out this weekend. It's close

Re: void * C array to a Numpy array using Swig

2006-01-13 Thread Travis E. Oliphant
Krish wrote: > Hello People > > I hope I am On Topic. Anyways, here is my problem. Any insights would > be really appreciated. Posting to the [EMAIL PROTECTED] list would help generate more responses, I think. > > I have wrapped a C IO module using SWIG -> Python Module. Suppose the > name of

Re: how do "real" python programmers work?

2006-01-13 Thread Travis E. Oliphant
bblais wrote: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the python sh

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Travis E. Oliphant
Philip Austin wrote: > "Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > > >>Krish wrote: > > >>Yes, you are right that you need to use typemaps. It's been awhile >>since I did this kind of thing, but here are some pointers. >

Re: Hypergeometric distribution

2006-01-02 Thread Travis E. Oliphant
Raven wrote: > Thanks Steven for your very interesting post. > > This was a critical instance from my problem: > > from scipy import comb >>> comb(14354,174) > > inf > > The scipy.stats.distributions.hypergeom function uses the scipy.comb > function, so it returned nan since it tries t

Re: csrss.exe & Numeric

2005-12-30 Thread Travis E. Oliphant
jelle wrote: > I have a function that uses the Numeric module. When I launch the > function csrss.exe consumes 60 / 70 % cpu power rather than having > python / Numeric run at full speed. Has anyone encountered this problem > before? It seriously messes up my Numeric performance. > Are you memory

Re: Best library for basic stats

2005-12-29 Thread Travis E. Oliphant
MKoool wrote: > Is there any decent library for basic stats? I am just looking for the > basics, like quartiles, median, standard deviation, mean, min, max, > regression, etc. > > I was going to use SciPy, but I use Python 2.4, and it seems to be > supported primarily for 2.3... > > What other s

Re: PythonMagick on Windows

2005-12-05 Thread Travis E. Oliphant
Adam Endicott wrote: > Does anyone know anything about PythonMagick? I've got a project that > could use ImageMagick, so I went looking around for PythonMagick, and > I'm a bit lost. > > I was able to download the PythonMagick source from the ImageMagick > site, but I'm on Windows and don't have t