Re: [Numpy-discussion] [OT] Why Python 'fits your brain'

2006-11-09 Thread Bill Baxter
I think Ruby users say the same about Ruby, maybe even more emphatically than Python users, and Ruby's chart looks like just about the most complicated one there. C and Python look to be about on par. Also I suspect a chart of Lisp's grammar would be even simpler than any of those up there, but

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Bill Baxter
Also have a look at the section on Arrays vs Matrices in the Numpy for Matlab users page. That particular section has nothing to do with Matlab, really. http://www.scipy.org/NumPy_for_Matlab_Users Most of the suggestions and comments made here are already on that page. --bb On 11/8/06, Joris De

Re: [Numpy-discussion] Stacking arrays...

2006-11-07 Thread Bill Baxter
dstack maybe? or does that add a dim on the other end?--bbOn 11/8/06, Christopher Barker [EMAIL PROTECTED] wrote:HI all,I'm trying to get the hang of this new r_ and c_ stuff. I need to take two MxN arrays, and stack them together into one MxNx2arrays. I found this works: a = N.ones((3,4)) b =

Re: [Numpy-discussion] Need more comments from scientific community on python-dev

2006-11-01 Thread Bill Baxter
Dalcin [EMAIL PROTECTED] wrote: On 10/31/06, Bill Baxter [EMAIL PROTECTED] wrote: One thing I see with PIL and Matplotlib and PyOpenGL is that they're having to add specific support for Numpy and numeric and numarray and PIL and ctypes etc.This is a real problem, and a waste of developing time

Re: [Numpy-discussion] Need more comments from scientific community on python-dev

2006-11-01 Thread Bill Baxter
On 11/2/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 01/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: And it may be a good idea to also have a get_ctype method or some-such on the ctypes attribute so thatone could get a ctypes description from the NumPy data-type.It seems to me that at the

Re: [Numpy-discussion] Need more comments from scientific community on python-dev

2006-10-31 Thread Bill Baxter
One thing I see with PIL and Matplotlib and PyOpenGL is that they're having to add specific support for Numpy and numeric and numarray and PIL and ctypes etc.I'm also in the camp that doesn't really understand this stuff well enough to really argue in favor of it, but would the proposed extensions

Re: [Numpy-discussion] Matrices for testing

2006-10-25 Thread Bill Baxter
On 10/26/06, jeremito [EMAIL PROTECTED] wrote: Hmmm.I guess I'll have to find another way to get somestandard/well-known matrices to work with.Thanks for your help.Well if all you want is some matrices, there's nothing stopping you from grabbing the matrices in the LAPACK distribution and using

Re: [Numpy-discussion] some work on arpack

2006-10-22 Thread Bill Baxter
Don't know if this is any use, but to me (not knowing Fortran nearly so well as C++) this looks pretty useful: http://www.caam.rice.edu/software/ARPACK/arpack++.html http://www.ime.unicamp.br/~chico/arpack++/ It provides a nice high-level interface on top of ARPACK. I could see it being useful

Re: [Numpy-discussion] some work on arpack

2006-10-21 Thread Bill Baxter
Here's something I've been wondering: is it ok to port Matlab functions over to python? If so, then it's maybe an afternoon's work to get eigs working, given eigs.m and python Arpack wrappers. I'm 99% sure it would *not* be kosher to copy-paste their code directly, but it's not a copy paste job

Re: [Numpy-discussion] some work on arpack

2006-10-21 Thread Bill Baxter
On 10/22/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/21/06, Bill Baxter [EMAIL PROTECTED] wrote: Here's something I've been wondering: is it ok to port Matlab functions over to python? If so, then it's maybe an afternoon's work to get eigs working, given eigs.m and python Arpack

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Bill Baxter
I think the answer to #3 is wrong. From 1.0rc2 I get: array([1,2,3,4,5,6],order='C').reshape((2,3),order='F') array([[1, 2, 3], [4, 5, 6]]) But the quiz wants me to answer something different. --bb - Using Tomcat

Re: [Numpy-discussion] [SciPy-dev] NumPy/SciPy + MPI for Python

2006-10-14 Thread Bill Baxter
On 10/15/06, A. M. Archibald [EMAIL PROTECTED] wrote: So, well, any suggestion for a name? pylab is already in use by matplotlib (for some reason), as is Scientific Python (and numpy, Numeric and numarray are obviously already confusing). I always thought 'pylab' was an odd name, so I always

[Numpy-discussion] How to make sqrt(-1) be 1j

2006-10-12 Thread Bill Baxter
On 10/12/06, Stefan van der Walt [EMAIL PROTECTED] wrote: On Thu, Oct 12, 2006 at 08:58:21AM -0500, Greg Willden wrote: On 10/11/06, Bill Baxter [EMAIL PROTECTED] wrote: I tried to explain the argument at http://www.scipy.org/NegativeSquareRoot The proposed fix for those who want sqrt(-1

Re: [Numpy-discussion] How to make sqrt(-1) be 1j

2006-10-12 Thread Bill Baxter
On 10/13/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/12/06, Bill Baxter [EMAIL PROTECTED] wrote: On 10/12/06, Stefan van der Walt [EMAIL PROTECTED] wrote: On Thu, Oct 12, 2006 at 08:58:21AM -0500, Greg Willden wrote: On 10/11/06, Bill Baxter [EMAIL PROTECTED] wrote: I tried

Re: [Numpy-discussion] How to make sqrt(-1) be 1j

2006-10-12 Thread Bill Baxter
On 10/13/06, Tim Hochberg [EMAIL PROTECTED] wrote: For this sort of thing, I would just make a new module to pull together the function I want and use that instead. It's then easy to explain that this new module bbeconf (Bill Baxter's Excellent Collection Of Numeric Functions) is actually an

Re: [Numpy-discussion] select part of array using two conditions

2006-10-11 Thread Bill Baxter
On 10/11/06, Nils Wagner [EMAIL PROTECTED] wrote: Mark Bakker wrote: Hello - I want to select part of an array using two conditions. I know how to do it with one condition (and it works great), but when I use two conditions I get an error message? This is probably easy, but I cannot

Re: [Numpy-discussion] round

2006-10-11 Thread Bill Baxter
Hmm. I learned round to even in school... But another formula that should get you what you want is: floor(x + 0.5).astype(int) --bb On 10/12/06, Greg Willden [EMAIL PROTECTED] wrote: Hi All, I've read discussions in the archives about how round() rounds to even and how that is supposedly

Re: [Numpy-discussion] incrementing along a diagonal

2006-10-11 Thread Bill Baxter
On 10/12/06, David Novakovic [EMAIL PROTECTED] wrote: Johannes Loehnert wrote: This is very nice, exactly what i want, but it doesnt work for mxn matricies: x = zeros((5,3)) x array([[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]) index =

Re: [Numpy-discussion] can this be made faster?

2006-10-08 Thread Bill Baxter
: invalid index whereas i would like to get array([3, 2]) On 10/8/06, Bill Baxter [EMAIL PROTECTED] wrote: Yes, that'd be a[b] += c On 10/8/06, Daniel Mahler [EMAIL PROTECTED] wrote: Is there a 'loop free' way to do this in Numeric for i in arange(l): a[b[i]]+=c[i

Re: [Numpy-discussion] can this be made faster?

2006-10-08 Thread Bill Baxter
So what's the answer then? Can it be made faster?--bbOn 10/9/06, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: Yes, that'd bea[b] += cNo, I'm afraid that fancy indexing does not do the loop that you are thinking it would (and for reasons that we've discussed previously on this list

Re: [Numpy-discussion] can this be made faster?

2006-10-07 Thread Bill Baxter
Yes, that'd be a[b] += c On 10/8/06, Daniel Mahler [EMAIL PROTECTED] wrote: Is there a 'loop free' way to do this in Numeric for i in arange(l): a[b[i]]+=c[i] where l == len(b) == len(c) thanks Daniel - Take

[Numpy-discussion] repmat

2006-10-05 Thread Bill Baxter
[There seem to have been some gmail delivery problems that prevented my previous mail on this subject from being delivered] I've proposed that we fix repmat handle arbitrary dimensions before 1.0. http://projects.scipy.org/scipy/numpy/ticket/292 I don't think this is particularly

Re: [Numpy-discussion] Shift or rotate command?

2006-09-24 Thread Bill Baxter
Went ahead and added an enhancement request: http://projects.scipy.org/scipy/numpy/ticket/293 This is something I've wanted in the past too. --bb On 9/25/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/24/06, Bill Baxter [EMAIL PROTECTED] wrote: Howdy Angus, Yeh, that does seem like

Re: [Numpy-discussion] Shift or rotate command?

2006-09-24 Thread Bill Baxter
is not what we've been calling 'rolling'. It's just a move, really (remove value from one place and re-insert in another). So perhaps the name should be 'moveaxis' instead? --bb On 9/25/06, Alan G Isaac [EMAIL PROTECTED] wrote: On Mon, 25 Sep 2006, Bill Baxter apparently wrote: Went ahead and added

Re: [Numpy-discussion] general version of repmat?

2006-09-23 Thread Bill Baxter
Here's a new version of 'reparray'. I tested the previous version against 'repmat' for the 2d case and found it to be as much as 3x slower in some instances. Ick. So I redid it using the approach repmat uses -- reshape() and repeat() rather than concatenate(). Now it's very nearly as fast as

Re: [Numpy-discussion] reading large files

2006-09-22 Thread Bill Baxter
Do you also have a 64-bit processor? Just checking since you didn't mention it. --bb On 9/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to read files 2Gbyte. From earlier posting I believed it should be possible with python 2.5. I am getting MemoryError when trying to

Re: [Numpy-discussion] general version of repmat?

2006-09-22 Thread Bill Baxter
On 9/22/06, Alan G Isaac [EMAIL PROTECTED] wrote: On Fri, 22 Sep 2006, Bill Baxter apparently wrote: Ok, here's my best shot at a generalized repmat: Sorry to always repeat this suggestion when it comes to repmat, but I think the whole approach is wrong. A repmat should be a separate

[Numpy-discussion] matrixmultiply moved (release notes?)

2006-09-21 Thread Bill Baxter
Apparently numpy.matrixmultiply got moved into numpy.oldnumeric.matrixmultiply at some point (or rather ceased to be imported into the numpy namespace). Is there any list of all such methods that got banished? This would be nice to have in the release notes. --bb

[Numpy-discussion] general version of repmat?

2006-09-21 Thread Bill Baxter
Is there some way to get the equivalent of repmat() for ndim == 1 and ndim 2. For ndim == 1, repmat always returns a 2-d array, instead of remaining 1-d. For ndim 2, repmat just doesn't work. Maybe we could add a 'reparray', with the signature: reparray(A, repeats, axis=None) where repeats is

Re: [Numpy-discussion] change of default dtype

2006-09-20 Thread Bill Baxter
PROTECTED] wrote: It is a wiki, and contributions are absolutely welcome, so please go ahead and change it to be more clear. Bill Baxter wrote: I think that's supposed to be covered by this line: The default array data-type is now float64 (c double precision) instead of c integer. But yeh, I

Re: [Numpy-discussion] max argmax combo

2006-09-19 Thread Bill Baxter
On 9/20/06, Francesc Altet [EMAIL PROTECTED] wrote: A Dimarts 19 Setembre 2006 19:21, Charles R Harris va escriure: Do you want both the indexes and index sorted array returned, or just sort the array using indexes, i.e., something like a.sort(kind=quicksort, method=indirect) Uh, I

Re: [Numpy-discussion] Fwd: Collection.findTransformation() never stops

2006-09-18 Thread Bill Baxter
Hey there, I don't see anything called LinearAlgegra.eigenvectors(). Do you maybe mean numpy.linalg.eig? Which version of numpy are you using? The latest release is 1.0b5. import numpy numpy.__version__ '1.0b5' numpy.linalg.eig([[2,1],[1,2]]) (array([ 3., 1.]), array([[ 0.70710678,

Re: [Numpy-discussion] unique1d: renaming retindx to return_index

2006-09-18 Thread Bill Baxter
Grepping through numpy/**/*.py, the only three functions I could find with an argument to specify extra return values are: linspace(start, stop, num=50, endpoint=True, retstep=False) average(a, axis=None weights=None, returned=False) unique1d(ar1, retindx=False) If unique1d is going to

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Bill Baxter
Iteration over axis 0 is built-in, so you can already do (vectorFunc(row) for row in array) And you can use transpose() to make it so the axis you want to iterate over is axis 0. (vectorFunc(col) for col in array.transpose(1,0)) Or just use the .T attribute (vectorFunc(col) for col in

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Bill Baxter
On 9/15/06, Tim Hochberg [EMAIL PROTECTED] wrote: Isn't swapaxis appropriate for this? In other words: You're right. Just didn't think of that. Never used swapaxes before. def axisiter(arr, i): return arr.swapaxes(0,i) --bb

Re: [Numpy-discussion] memory corruption bug

2006-08-28 Thread Bill Baxter
Nope, that's the way python works in general for any type other than basic scalar types. a = [1,2,3,4] b = a b[1] = 99 print a [1, 99, 3, 4] print b [1, 99, 3, 4] Also the issue never comes up for types like tuples or strings because they aren't mutable. --bb On 8/28/06, Sven Schreiber

Re: [Numpy-discussion] Deleting a row from a matrix

2006-08-26 Thread Bill Baxter
On 8/26/06, Francesc Altet [EMAIL PROTECTED] wrote: I'm personally an addict to encapsulate as much functionality as possible inmethods (but perhaps I'm biased by an insane use of TAB in ipython console).You can still get tab completion for functions: numpy.TAB Even if it's your custom to from

Re: [Numpy-discussion] Deleting a row from a matrix

2006-08-26 Thread Bill Baxter
On 8/26/06, Travis Oliphant [EMAIL PROTECTED] wrote: I've come up with adding the functions (not methods at this point)deletefrominsertintodelete and insert really would be better. The current insert function seems inaptly named. What it does sounds more like overlay or set_masked. ... or the

Re: [Numpy-discussion] memory corruption bug

2006-08-26 Thread Bill Baxter
You're sure it's not just pass-by-reference semantics biting you?If you make an array and pass it to another class or function, by default they just get a reference to the same array.so e.g.:a = numpy.array ([1,2,3])some_class.set_array(a)a[1] = 10Then both the local 'a' and the 'a' that

Re: [Numpy-discussion] users point of view and ufuncs

2006-08-24 Thread Bill Baxter
On 8/24/06, Sasha [EMAIL PROTECTED] wrote: On 8/24/06, Bill Baxter [EMAIL PROTECTED] wrote: [snip] it would be nice to add a concise definition of ufunc to the numpy glossary: http://www.scipy.org/Numpy_Glossary. done Can anyone come up with such a definition? I copied

Re: [Numpy-discussion] request for new array method: arr.abs()

2006-08-23 Thread Bill Baxter
The thing that I find I keep forgetting is that abs() is a built-in, but other simple functions are not. So it's abs(foo), but numpy.floor(foo) and numpy.ceil(foo). And then there's round() which is a built-in but can't be used with arrays, so numpy.round_(foo). Seems like it would be more

Re: [Numpy-discussion] users point of view and ufuncs

2006-08-23 Thread Bill Baxter
On 8/24/06, Sebastian Haase [EMAIL PROTECTED] wrote: I'm not sure what this question is asking, so I'll answer what I think it is asking. The mean, min, max, and average functions are *not* ufuncs. They are methods of particular ufuncs. Yes - that's whatwanted to hear !I'm just trying to bring in

[Numpy-discussion] linspace upper bound not met?

2006-08-21 Thread Bill Baxter
I was porting some code over from matlab in which I relied on the upper bound of linspace to be met exactly.It turns out that it isn't always exactly met in numpy.In [390]: filter(lambda x: x[1]!=0.0, [ (i, 1.0-numpy.linspace(0,1,i)[-1]) for i in range(2,200) ])Out[390]:[(50,

Re: [Numpy-discussion] linspace upper bound not met?

2006-08-21 Thread Bill Baxter
Out of curiosity I checked on what matlab does. It does explicity set the last value to 'stop' to avoid the roundoff issue.In numpy terms, it does something like y = r_[start+r_[0:num-1]*(stop-start)/(num-1.0 ), stop]But for numpy it's probably more efficient to just do the 'y[-1] = stop' like

Re: [Numpy-discussion] numpy.random.rand function doesn't take tuple

2006-08-21 Thread Bill Baxter
If you like, here's a rand function that takes either a sequence or a tuple. I use this for interactive sessions.def rand(*shape): Return an array of the given dimensions which is initialized to random numbers from a uniform distribution in the range [0,1). rand(d0, d1, ..., dn) - random values

Re: [Numpy-discussion] bug with numpy.linalg.eig for complex output

2006-08-18 Thread Bill Baxter
Thanks for the info Nils. Sounds like it was fixed post-1.0b1. Good news.And Trac seems to be letting me in again. Not sure what was wrong there.--bbOn 8/18/06, Nils Wagner [EMAIL PROTECTED] wrote: Bill Baxter wrote: If you do this: numpy.linalg.eig(numpy.random.rand(3,3)) You'll (almost always

Re: [Numpy-discussion] numpy and matplotlib

2006-08-08 Thread Bill Baxter
Matplotlib needs to be recompiled against the latest Numpy.They should release a new version compatible with Numpy 1.0 beta soon.--bbOn 8/9/06, George Gumas [EMAIL PROTECTED] wrote:I downloaded numpy 1 and matplotlib and when running numpy i get the error message below from

Re: [Numpy-discussion] Examples of basic C API usage?

2006-08-08 Thread Bill Baxter
Ah, great. That is helpful, though it does seem to be a bit outdated.--bbOn 8/8/06, Karol Langner [EMAIL PROTECTED] wrote:On Tuesday 08 of August 2006 05:18, Bill Baxter wrote: I see Pyrex and SWIG examples in numpy/doc but there doesn't seem to be an example of just a simple straightforward

Re: [Numpy-discussion] NumPy, shared libraries and ctypes

2006-08-08 Thread Bill Baxter
On 8/9/06, Albert Strasheim [EMAIL PROTECTED] wrote: Next caveat: on Windows, shared libraries aka DLLs, typically have a .dllextension. However, Python extensions have a .pyd extension.We have a utility function in NumPy called ctypes_load_library which handles finding and loading of shared

[Numpy-discussion] Examples of basic C API usage?

2006-08-07 Thread Bill Baxter
I see Pyrex and SWIG examples in numpy/doc but there doesn't seem to be an example of just a simple straightforward usage of the C-API.For instance make a few arrays by hand in C and then call numpy.multiply() on them. So far my attempts to call PyArray_SimpleNewFromData all result in segfaults.

Re: [Numpy-discussion] comments on r_ and c_ ?

2006-08-06 Thread Bill Baxter
On 8/1/06, Travis Oliphant [EMAIL PROTECTED] wrote: Bill Baxter wrote: When you have a chance, could the powers that be make some comment on the r_ and c_ situation? r_ and c_ were in SciPy and have been there for several years. For NumPy, c_ has been deprecated (but not removed because

Re: [Numpy-discussion] Graph class

2006-08-01 Thread Bill Baxter
Hi David, For a graph, the fact that it's stored as a matrix, or stored as linked nodes, or dicts, etc, is an implementation detail. So from a classical OO point of view, inheritance is not what you want. Inheritance says this is a kind of that. But a graph is not a kind of matrix. A matrix

Re: [Numpy-discussion] [SciPy-user] concatenate, r_ ...

2006-07-30 Thread Bill Baxter
By the way, you seem puzzled by the behaviour of column_stack. I think it fits well with the docstring. What was unexpected to me was its behavior when handling inputs that are not 1-d. The docstring doesn't say what will happen in that case. But my expectation is that it should associate.

Re: [Numpy-discussion] trivial question: how to compare dtype - but ignoring byteorder ?

2006-07-24 Thread Bill Baxter
And I think byteorder matters when comparing dtypes: numpy.dtype('f4') == numpy.dtype('f4') False Oh -- that '' part is indicating *byte order* ?! I thought it was odd that numpy could only tell me the type was less than f4, which I assumed must be shorthand for less than or equal to

Re: [Numpy-discussion] Please comment on SVN versioning convention

2006-07-24 Thread Bill Baxter
On 7/25/06, Andrew Straw [EMAIL PROTECTED] wrote: 1.0.2881 - This would sort after 1.0 (and 1.0b and 1.0c) and before 1.1 for most tools out there. I like that best. Save the 1.1 prefix until it's actually released as such. The numbering scheme needs to deal with what to call the patch tip of

Re: [Numpy-discussion] matrix-related bug in 1.0b1

2006-07-23 Thread Bill Baxter
Howdy, On 7/22/06, Sven Schreiber [EMAIL PROTECTED] wrote: Hi, Summary: Slicing seems to be broken with matrices now. ... Example: import numpy as n n.__version__ '1.0b1' import numpy.matlib as m a = n.zeros((2,3)) b = m.zeros((2,3)) a[:1,:].shape (1, 3) b[:1,:].shape (3,

Re: [Numpy-discussion] r_, c_, hstack, and vstack with 1-d arrays

2006-07-22 Thread Bill Baxter
I looked into the various concatenation methods a bit more to better understand what's going on under the hood. Here's essentially what these different methods do: vstack(tup): concatenate( map(atleast_2d,tup), axis=0 ) hstack(tup): concatenate( map(atleast_1d,tup),axis=1 )

[Numpy-discussion] appending/inserting/deleting axes of arrays

2006-07-22 Thread Bill Baxter
Howdy, Is there any nicer syntax for the following operations on arrays? Append a row: a = vstack((a,row)) Append a column: a = hstack((a,col)) Append a row of zeros: a = vstack((a,zeros((1,a.shape[1] Append a col of zeros: a = hstack((a,zeros((a.shape[0],1 Insert a row before row j a

Re: [Numpy-discussion] r_, c_, hstack, and vstack with 1-d arrays

2006-07-22 Thread Bill Baxter
On 7/21/06, Sven Schreiber [EMAIL PROTECTED] wrote: Bill Baxter schrieb: Finally, I noticed that the atleast_nd methods return arrays regardless of input type. Are you sure? I reported that issue with *stack and I remember it was fixed. Doh! My bad. You're right. I was looking

[Numpy-discussion] r_, c_, hstack, and vstack with 1-d arrays

2006-07-19 Thread Bill Baxter
For 1-d inputs I think r_ should act like vstack, and c_ should act like column_stack. Currently r_ and c_ both act like hstack for 1-d inputs. Background: I keep getting bitten by the fact that this doesn't work: a = array([1,2,3]) b = array([[1,2,3],[2,3,4]]) c = array([4,5,6]) r_[b,c]

Re: [Numpy-discussion] Scalars, comparisons and indexing. Is this a bug?

2006-07-14 Thread Bill Baxter
I believe that's the problem that the indexing PEP from Travis is supposed to address: http://www.python.org/dev/peps/pep-0357/ So I think there's not much anyone can do about it untill the PEP is accepted and implemented. Maybe you can cast to int? In [34]: (1,2)[int(a[0]==b)] --bb On

Re: [Numpy-discussion] LAPACK Problem with import numpy on AIX

2006-07-13 Thread Bill Baxter
On 7/13/06, Adam Carter [EMAIL PROTECTED] wrote: Hi all,Do I need lapack_lite aswell? Where can I get it? If I need this otherLAPACK, how can I ensure that my code uses the optimised version of LAPACKalready on this system I'm using? Lapack_lite is in the numpy sources. I think it's the fallback

[Numpy-discussion] Args for rand and randn, and workarounds

2006-07-12 Thread Bill Baxter
And mark my words, if we make rand() polymorphic, we will get just as many newbies coming to the list asking why ones(3, 4)doesn't work. I think you're probably right there, at least for Matlab converts. Matlab allows either way of calling for all of rand, ones, zeros, eye, and in general tries to

Re: [Numpy-discussion] Building SciPy under Windows attn. Bill Baxter

2006-07-12 Thread Bill Baxter
Thanks, that seems to have done the trick!I've got a SVN Scipy now!I updated the building scipy wiki page with this piece of advice.--bbOn 7/13/06, John Carter [EMAIL PROTECTED] wrote: I had problems building SciPy and NumPy under Windows. They went awaywhen I stopped using the stable version of

[Numpy-discussion] determining if you have ATLAS or not

2006-07-12 Thread Bill Baxter
How can you probe numpy for info about what sort of BLAS/LAPACK you have, or other build configuration info?Searching the ml archives I turned up this one hint from Travis, which can be embodied in code thusly: import numpy def have_blas(): return id(numpy.dot) !=

Re: [Numpy-discussion] building ATLAS on Win32 - endless compile loop

2006-07-09 Thread Bill Baxter
I did some searching on the web and found that Pentium M is more or less a Pentium III.After selecting Pentium III in the ATLAS setup, the build worked. Still, on my ~1GHz laptop took several hours, nothing like the 15 minutes advertised on the Wiki. (I updated the wiki accordingly) Just out of

[Numpy-discussion] building ATLAS on Win32 - endless compile loop

2006-07-08 Thread Bill Baxter
Trying to compile Atlas from source on Win32 with Cygwin. Anyone seen 'make install' for ATLAS go into and endless loop before?More info:Following the instructions here: Installing SciPy/Windows - SciPy.orgAt this step: 5) As prompted by the config script, execute

Re: [Numpy-discussion] What's wrong with matrices?

2006-07-08 Thread Bill Baxter
My preferred way to import numpy currently is:import numpy as numIt would be nice if I could do:import numpy.matrix as num And basically have access to all the same stuff that's in the base numpy but have everything set up in a matrix-like way, so num.ones returns a matrix instead of an array,

Re: [Numpy-discussion] Args for rand and randn: call for a vote

2006-07-08 Thread Bill Baxter
* Should numpy.rand and numpy.randn accept sequences of dimensions as arguments, like rand((3,3)), as an alternative to rand(3,3)? +1 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download

Re: [Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-07 Thread Bill Baxter
On 7/7/06, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: I am also curious, given the number of times I've heard this nebulous argument of there are lots kinds of numerical computing that don't invlolve linear algebra, that no one ever seems to name any of these lots of kinds.Statistics

Re: [Numpy-discussion] Call for a vote on .M .A .T .H attributes

2006-07-07 Thread Bill Baxter
On 7/7/06, Travis Oliphant [EMAIL PROTECTED] wrote: 1) .THave some kind of .T attribute+1 If 0 on this then: a) .T == .swapaxes(-2,-1)+1 b) .T == .transpose() +0 c) .T raises error for ndim 2 +0 d) .T returns (N,1) array for length (N,) array +1 e) .T returns self for ndim 2+0 2) .Hreturns

Re: [Numpy-discussion] Enhancing dot()

2006-07-07 Thread Bill Baxter
On 7/7/06, Tim Hochberg [EMAIL PROTECTED] wrote: The funny thing is that having a dot(a,b,c,...) would lead to the exact same kind of hidden performance problems you're arguing against.Not exactly arguing -- this isn't why I don't like H and friends -- just noting that this is one of the traps

Re: [Numpy-discussion] What's wrong with matrices?

2006-07-07 Thread Bill Baxter
On 7/7/06, Ed Schofield [EMAIL PROTECTED] wrote: Bill Baxter wrote: I would be all for a matrix class that was on equal footing with array and as easy to use as matrices in Matlab.But my experience using numpy.matrix was far from that, and, given the lack of enthusiasm for matrices around here

Re: [Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-06 Thread Bill Baxter
On 7/6/06, Tim Hochberg [EMAIL PROTECTED] wrote: -) Being able to distinguish between row and column vectors; I guess this is just not possible with arrays...Why can't you distinguish between them the same way that the matrixclass does? Shape [1, N] is a row array, shape [N,1] is column array.

Re: [Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-06 Thread Bill Baxter
packages like matlab. Then given the current situation, I like the .M but I can imagine other ways to make .M less necessary. --bbOn 7/6/06, Travis Oliphant [EMAIL PROTECTED] wrote: Bill Baxter wrote: So in short my proposal is to: --make a.T a property of array that returns a.swapaxes(-2,-1

Re: [Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-06 Thread Bill Baxter
Tim Wrote:That second argument is particularly uncompelling, but I think I agreethat in a vacuum swapaxes(-2,-1) would be a better choice for .T than reversing the axes. However, we're not in a vacuum and there are severalreasons not to do this. 1. A.T and A.transpose() should really have the

Re: [Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-06 Thread Bill Baxter
On 7/7/06, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: Robert Kern wrote: The slippery slope argument only applies to the .M, not the .T or .H.No, it was the Let's have a .T attribute. And if we're going to do that, then we should also do this. And this. And this.There's no slippery

[Numpy-discussion] .T Transpose shortcut for arrays again

2006-07-04 Thread Bill Baxter
Just wanted to make one last effort get a .T attribute for arrays, so that you can flip axes with a simple a.T instead of a.transpose(), as with numpy matrix objects.If I recall, the main objection raised before was that there are lots of ways to transpose n-dimensional data. Fine, but the fact is

Re: [Numpy-discussion] Combining arrays together

2006-07-03 Thread Bill Baxter
Neat, didn't know about that. But, grr, always returns matrix regardless of argument types.--bbOn 7/3/06, Alan G Isaac [EMAIL PROTECTED] wrote:On Mon, 3 Jul 2006, Bill Baxter apparently wrote: What's the best way to combine say several 2-d arrays together into a grid? help(N.bmat)Help

[Numpy-discussion] Args for ones, zeros, rand, eye, ones, empty (possible 1.0 change?)

2006-07-02 Thread Bill Baxter
Here's another possible now or never change:fix rand(), eye(), ones(), zeros(), and empty() to ALL take either a tuple argument or plain list.I know this has been discussed before, but I really don't see why these methods can't be overloaded to accept either one. Here are some wrappers I cooked

[Numpy-discussion] Combining arrays together

2006-07-02 Thread Bill Baxter
What's the best way to combine say several 2-d arrays together into a grid?Here's the best I can see: a = eye(2,2) b = 2*a c = 3*a d = 4*a r_[c_[a,b],c_[c,d]] array([[1, 0, 2, 0], [0, 1, 0, 2], [3, 0, 4, 0], [0, 3, 0, 4]])In matlab you'd get the same effect by saying: [ a, b; c, d ]Compared to

Re: [Numpy-discussion] Time for beta1 of NumPy 1.0

2006-06-29 Thread Bill Baxter
Rand at least returns doubles: num.rand(3,3).dtype.name'float64'--bbOn 6/30/06, Keith Goodman [EMAIL PROTECTED] wrote:On 6/29/06, Bill Baxter [EMAIL PROTECTED] wrote: I also find the int behavior of these functions strange. +1 float default (or double)Oh, wait. Which do I want, float or double

Re: [Numpy-discussion] Matrix construction

2006-06-22 Thread Bill Baxter
On 6/22/06, Ed Schofield [EMAIL PROTECTED] wrote: On 22/06/2006, at 12:40 AM, Bill Baxter wrote: Actually I think using mat() (just an alias for the matrix constructor) is a bad way to do it.That mat() (and most others on that page) should probably be replaced with asmatrix() to avoid

Re: [Numpy-discussion] Selecting columns of a matrix

2006-06-20 Thread Bill Baxter
On 6/21/06, Erin Sheldon [EMAIL PROTECTED] wrote: On 6/20/06, Bill Baxter [EMAIL PROTECTED] wrote: I think that one's on the NumPy for Matlab users, no? http://www.scipy.org/NumPy_for_Matlab_Users import numpy as num a = num.arange (10).reshape(2,5) a array([[0, 1, 2, 3, 4],[5, 6, 7, 8, 9