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

Re: Random Drawing Simulation -- performance issue

2006-09-12 Thread Travis E. Oliphant
s = N.random.rand(count) cprobs = N.cumsum([0]+probs) nums *= cprobs[-1] for k, val in enumerate(probs): res[k][0] += ((nums > cprobs[k]) & (nums < cprobs[k+1])).sum() return res -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

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

2006-09-20 Thread Travis E. Oliphant
interpreted as (PyObject **) -- an array of PyObject *'s, and then de-referenced to get the PyObject * present at the first address So. this should work to check that the first entry in the array is a string: PyString_Check( *( ( PyObject ** )( pArray->data ) ) ); By the way, NumPy

Re: switching to numpy and failing, a user story

2006-10-04 Thread Travis E. Oliphant
mPy is growing and I expect that trend to continue. There is a lot of information in the source file. > > I guess I'll come back to NumPy in 2010, when the docs are available. > Or just ask on the mailing lists, use the numpy.oldnumeric interface (the differences are all documented in the first few pages of my book which is available for free now). Thanks, -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Multidimesional array(newbie)

2006-12-12 Thread Travis E. Oliphant
solution to this question that works with numpy. You can also view the array using fields and then sort (which will do lexicographic ordering) and convert the result back to the original view. Something like this: a = array([[5,2],[1,3]]) dt = a.dtype g = a.view([('',dt),('

Re: Possible memory leak?

2006-01-24 Thread Travis E. Oliphant
a=data+row > > > The purpose of this part of a program is to take a 14 bit numerical > representation and convert it to an 8 bit representation. This is exactly the kind of thing NumPy (http://numeric.scipy.org) is ideal for. If that's of interest to you, then I can offer particular suggestions... -Travis -- http://mail.python.org/mailman/listinfo/python-list

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

2006-01-24 Thread Travis E. Oliphant
y to profile the C++ functions? > On Linux you can use oprofile (which is pretty nice and easy to use --- no recompiling. Just start the profiler, run your code, and stop the profiler). http://oprofile.sourceforge.net/about/ -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: writing arrays to binary file

2006-01-25 Thread Travis E. Oliphant
ut 4 decimal places. You need to use the tostring() method and write that out in binary form. flon = open(lon_file,'wb') flon.write(your2darray.tostring()) of course you will need to manage byte-order issues if you will be transferring this file to a different kind of processor. Alternatively, with new NumPy there is a tofile method that you can use to write in either ascii or binary form. -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

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: Scientific Computing with NumPy

2006-02-06 Thread Travis E. Oliphant
of the improvements). If there are missing improvements we need to know about them. Thanks to Tim for spreading some light on the issue. There will no doubt be continued confusion for new users over the coming months. Hopefully, with time the confusion will fade as more people use NumPy and any remainging issues get resolved. -Travis -- http://mail.python.org/mailman/listinfo/python-list

ANN: Release of NumPy 0.9.5

2006-02-16 Thread Travis E. Oliphant
s at http://sourceforge.net/project/shownotes.php?release_id=394206&group_id=1369 Best regards, -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

Re: calculating on matrix indices

2006-02-16 Thread Travis E. Oliphant
change x to be double precision: x = zeros(len(t), float) #the default Python float is doubleprecision or change t to be single precision: t = arange(0,20,.1,dtype=single) Good luck, -Travis -- http://mail.python.org/mailman/listinfo/python-list

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: ANN: Release of NumPy 0.9.5

2006-02-18 Thread Travis E. Oliphant
rough the C-code for other cases as well because of the increased flexibility. Our goal is to be as fast as we can be so give it a spin and tell us how to improve... Thanks, -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Scientific Computing with NumPy

2006-02-28 Thread Travis E. Oliphant
simply by replacing Numeric/arrayobject.h with numpy/arrayobject.h If you don't like things then start suggesting specific improvements at [EMAIL PROTECTED] instead of just ranting on the python list which most of us don't have the time to read anyway (notice how late I'm responding to this...) -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with numpy-0.9.4 and numpy-0.9.5

2006-03-01 Thread Travis E. Oliphant
vior experienced by others on the Debian platform. There is a patch, but I'm not sure what it is. See, for example: http://aspn.activestate.com/ASPN/Mail/Message/numpy-discussion/2207861 Come over to the [EMAIL PROTECTED] and/or [EMAIL PROTECTED] lists for more help. -Travis -- http://mail.python.org/mailman/listinfo/python-list

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

2007-04-23 Thread Travis E. Oliphant
ds on the type of > scalar). > numpy scalars are try a lot more things before giving up on multiplication and letting the other class have a stab at it. Post your problems to the numpy discussion list for better help and more discussion. -Travis -- http://mail.python.org/mailman/listinfo/python-list

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: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-11 Thread Travis E. Oliphant
YI - The csv file was > a simple 6 column file with a header row and more than a million > records. > > There is some facility to read simply-formatted files directly into NumPy. You might try something like this. numpy.fromfile('somename.csv', sep=',') an

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

2007-01-11 Thread Travis E. Oliphant
r row yourself. Something like this: fid = open('somename.csv') data = numpy.fromfile(fid, sep=',').reshape(-1,6) # for 6-column data. -Travis -- http://mail.python.org/mailman/listinfo/python-list

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

2007-01-15 Thread Travis E. Oliphant
hat it is not a very sophisticated csv reader (it only understands a single separator (plus line-feeds are typically seen as a separator). -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy or _numpy or Numeric?

2007-01-23 Thread Travis E. Oliphant
an easily read space-separated values from a file by reading in a line at a time and using the split method of strings: fid = open('filename') linedata = fid.readlines() new = [[float(x) for x in line.split()] for line in linedata] new will be a nested sequence of floats. You can

Re: numpy or _numpy or Numeric?

2007-01-24 Thread Travis E. Oliphant
But, the documentation is old. But, it is still useful (except for Numeric specific information like how to install it). Therefore we still make a link to it. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: segmentation fault in scipy?

2006-05-10 Thread Travis E. Oliphant
numpy-discussion list for better feedback. Does it actually segfault or give you this Memory Error? Temporary arrays that need to be created could be the source of the extra memory. Generally, you should be able to use all the memory on your system (unless you are on a 64-bit system and

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: Scipy: vectorized function does not take scalars as arguments

2006-05-24 Thread Travis E. Oliphant
torize handles scalars in recent versions of NumPy. Which version do you have? -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for triangulator/interpolator

2006-05-26 Thread Travis E. Oliphant
-1:1:70j] ynew = r_[-1:1:70j] znew = interpolate.bisplev(xnew,ynew,tck) There is a buglet that is fixed in SVN scipy that means you need to enter xb, xe, yb, and ye manually. -Travis -- http://mail.python.org/mailman/listinfo/python-list

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: matplotlib and numpy installation

2006-05-27 Thread Travis E. Oliphant
> extra options: '-DSCIPY=1' > gcc: src/_image.cpp > src/_image.cpp:5:17: png.h: No such file or directory This is the source of the remaining errors On my system the "png.h" file comes from a libpng3-devel rpm Perhaps you need to use apt-get to obtain the development package for png. -Travis -- http://mail.python.org/mailman/listinfo/python-list

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: Texas Python Regional Unconference Reminders

2008-10-01 Thread Travis E. Oliphant
Travis Vaught wrote: Greetings, The Texas Python Regional Unconference is coming up this weekend (October 4-5) and I wanted to send out some more details of the meeting. The web page for the meeting is here: http://www.scipy.org/TXUncon2008 The meeting is _absolutely free_, so please add

Re: installing numpy

2006-03-15 Thread Travis E. Oliphant
up.py though, there is no need). After copying the files over to your site-packages directory, just start python and do import numpy -Travis -- http://mail.python.org/mailman/listinfo/python-list

how to use WSGI applications with apache

2009-10-07 Thread travis+ml-python
#x27;t figure it out how to do again. Any help? -- Obama Nation | My emails do not have attachments; it's a digital signature that your mail program doesn't understand. | http://www.subspacefield.org/~travis/ If you are a spammer, please email j...@subspacefield.org to get blacklist

Re: Is Python a functional programming language?

2010-05-15 Thread travis+ml-python
s, iterators, generators, metaclasses, and the proliferation of special method names, I have to wonder if that still holds true... certainly I understand 90+% of python programs, but do I understand that proportion of the constructs? PS: Why do people call LISP object-oriented? Are they smoking

pythonic web markup languages & templating systems & site generators

2010-06-05 Thread travis+ml-python
inquiry (still ongoing) are here: http://www.subspacefield.org/~travis/static_blog_generators.html It's a little disorganized, but does represent a fair amount of work, and might be a nice intro for a python programmer who isn't up to his neck in web authoring tools. Suggestions on how t

proposal: add setresuid() system call to python

2009-07-17 Thread travis+ml-python
should implement the ones with the clearest semantics, and setresuid fits that bill. To see what an utter mess the uid-manipulation routines are in, I refer you once again to this paper, as the situation is too complicated to describe in this email: http://www.eecs.berkeley.edu/~daw/papers/setuid-us

Re: proposal: add setresuid() system call to python

2009-08-21 Thread travis+ml-python
raise command won't work in Python 2.6.1; it turns out that os.errno is a module, not an integer. Does anyone know how to do what I want (that is, how to access the errno set in C functions)? -- Obama Nation | My emails do not have attachments; it's a digital signature that your mail pro

Re: proposal: add setresuid() system call to python

2009-08-25 Thread travis+ml-python
ted the module here: http://www.subspacefield.org/~travis/python/privilege/ I could sure use any comments people had on my python style. PyPi link: http://pypi.python.org/pypi/privilege/1.0 -- Obama Nation | My emails do not have attachments; it's a digital signature that your mail pr

run-time inclusion of files

2009-09-05 Thread travis+ml-python
m also pretty sure that there's a simple solution, I am just not aware of what it is. -- Obama Nation | My emails do not have attachments; it's a digital signature that your mail program doesn't understand. | http://www.subspacefield.org/~travis/ If you are a spammer,

<    1   2   3