Re: [Numpy-discussion] Movement of ma breaks matplotlib

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 11:19 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > Hi, > > In the upcoming release of numpy. numpy.core.ma ceases to exist. One > must use numpy.ma (for the new interface) or numpy.oldnumeric.ma (for > the old interface). This has the unfortunate effect of breaking > mat

[Numpy-discussion] Movement of ma breaks matplotlib

2008-04-25 Thread Anne Archibald
Hi, In the upcoming release of numpy. numpy.core.ma ceases to exist. One must use numpy.ma (for the new interface) or numpy.oldnumeric.ma (for the old interface). This has the unfortunate effect of breaking matplotlib(which does "from numpy.core.ma import *") - I cannot even "import pylab" with a

Re: [Numpy-discussion] OSX installer: please test

2008-04-25 Thread Christopher Burns
There is also a gui, Disk Utility.app which is what I used for the installer. Chris On Fri, Apr 25, 2008 at 2:17 AM, Sebastian Haase <[EMAIL PROTECTED]> wrote: OT: How do you make a dmg ? Is there a (simple) command line tool for this ? Thanks, Sebastian Haase On Fri, Apr 25, 2008 at 1:35 PM,

Re: [Numpy-discussion] prerelease proposal for matrix behavior

2008-04-25 Thread Bill Baxter
On Sat, Apr 26, 2008 at 10:27 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Fri, Apr 25, 2008 at 6:38 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > > OK, we are not converging in time for the release. > > So can we at least raise a TypeError on scalar > > indexing of matrices, so that we

Re: [Numpy-discussion] prerelease proposal for matrix behavior

2008-04-25 Thread Travis E. Oliphant
Alan G Isaac wrote: > OK, we are not converging in time for the release. > So can we at least raise a TypeError on scalar > indexing of matrices, so that we remain free to choose > the ultimate behavior? > I think this is wise for the time being. At this point, I'm leaning in the direction of t

Re: [Numpy-discussion] prerelease proposal for matrix behavior

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 6:38 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > OK, we are not converging in time for the release. > So can we at least raise a TypeError on scalar > indexing of matrices, so that we remain free to choose > the ultimate behavior? > > Those who have spoke up have generall

[Numpy-discussion] 2D array to 3D

2008-04-25 Thread tournesol
Hi All. Is there a easy way to insert 1D(j) array into another 2D array(B:jxk) and conver B to B:ixjxk ? ex:) >>> from numpy import * >>> a=arange(4) >>> a array([0, 1, 2, 3]) >>> b=arange(9) >>> b.shape=3,3 >>> b array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) I just wanna insert A into B B:1x3x3, [

Re: [Numpy-discussion] prerelease proposal for matrix behavior

2008-04-25 Thread Alan G Isaac
OK, we are not converging in time for the release. So can we at least raise a TypeError on scalar indexing of matrices, so that we remain free to choose the ultimate behavior? Those who have spoke up have generally favored letting x[0] return a 1d array, if I count correctly. And I think that is t

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Hoyt Koepke
Another suggestion from machine learning stuff to throw into the mix: A soft step function that we use often is y = e^(ax) / ( 1 + e^(ax)). It has the nice property that the result y is always in (0,1). If you invert this, you get x = -(1/a)*log(y - 1); this maps (0,1) to the whole real line, and

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 1:25 PM, Rich Shepard <[EMAIL PROTECTED]> wrote: > On Fri, 25 Apr 2008, Charles R Harris wrote: > > > You can use something like f(x) = (1-x**2)**2 , which has inflection > > points and vanishes at +/- 1. Any of the B-splines will also do the > trick. > > Chuck, > > Thank

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Gael Varoquaux
On Fri, Apr 25, 2008 at 01:41:14PM -0500, Robert Kern wrote: > As Anne notes, "bell-shaped curve," while seemingly generic, usually > specifies Gaussians, and Gaussians do not have the properties you need. > There are any number of curves which we could (and have) suggested as > "looking bell-shape

Re: [Numpy-discussion] Does Unreasonable Matrix Behavior affectScipy Sparse

2008-04-25 Thread Alan G Isaac
>> 1. Please post a small example. 2. Do you have the very >> latest SVN (post r5084)? On Fri, 25 Apr 2008, Dinesh B Vadhia apparently wrote: > I have a working program with b=Ax, where A is a large > sparse matrix. However, I need the int8 support in the > sparse library to utilize much lar

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Alan G Isaac
>> On Fri, 25 Apr 2008, Christopher Barker apparently wrote: >>> I think a Vector object would allow both of: >>> M[i,j] == M[i][j] >>> and >>> M[i] == M[i,:] > On Fri, Apr 25, 2008 at 2:57 PM, Alan G Isaac > <[EMAIL PROTECTED]> wrote: >> The problem is that it would be a crime to give up >>

Re: [Numpy-discussion] Does Unreasonable Matrix Behavior affectScipy Sparse

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 2:46 PM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > Alan > > I posted this on the scipy list: > > I have a working program with b=Ax, where A is a large sparse matrix. > However, I need the int8 support in the sparse library to utilize much > larger matrices. I managed

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 2:57 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On Fri, 25 Apr 2008, Christopher Barker apparently wrote: > > I think a Vector object would allow both of: > > M[i,j] == M[i][j] > > and > > M[i] == M[i,:] > > The problem is that it would be a crime to give up > the natura

Re: [Numpy-discussion] numpy release

2008-04-25 Thread David Huard
Thanks Chuck, I didn't know there were other tests for histogram outside of test_function_base. The error is now raised only if bins are passed explicitly and normed=True. David 2008/4/25 Charles R Harris <[EMAIL PROTECTED]>: > > > On Fri, Apr 25, 2008 at 12:55 PM, Jarrod Millman <[EMAIL PROTE

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Christopher Barker apparently wrote: > I think a Vector object would allow both of: > M[i,j] == M[i][j] > and > M[i] == M[i,:] The problem is that it would be a crime to give up the natural production of submatrices. The NATURAL RULE is: to get a submatrix, use nonscalar

Re: [Numpy-discussion] Does Unreasonable Matrix Behavior affectScipy Sparse

2008-04-25 Thread Dinesh B Vadhia
Alan I posted this on the scipy list: I have a working program with b=Ax, where A is a large sparse matrix. However, I need the int8 support in the sparse library to utilize much larger matrices. I managed to get hold of a numpy svn 5066 and scipy svn 4167 build, and b=Ax now returns garbage

Re: [Numpy-discussion] OSX installer: please test

2008-04-25 Thread Christopher Barker
David Cournapeau wrote: > To get to your point: hdiutil is the command you are looking for. yup. Here's an example: hdiutil create -srcfolder YourDir -volname "A Name" -ov "Something.dmg" It will build a disk image from the directory: YourDir -Chris -- Christopher Barker, Ph.D. Oceanographer

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 12:55 PM, Jarrod Millman <[EMAIL PROTECTED]> wrote: > On Fri, Apr 25, 2008 at 12:55 PM, David Huard <[EMAIL PROTECTED]> > wrote: > > > Done in r5085. I added a bunch of tests, but I'd appreciate if someone > > could double check before the release. This is not the time to i

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Christopher Barker
Alan G Isaac wrote: > Please return 1d arrays in response to scalar > indexing as the provisional arrangement. +1 (for the provisional solution) This has clarified it a bit for me. The current situation allows one to create "row vectors" and "column vectors" by generating matrices (in various w

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Rich Shepard
On Fri, 25 Apr 2008, Charles R Harris wrote: > You can use something like f(x) = (1-x**2)**2 , which has inflection > points and vanishes at +/- 1. Any of the B-splines will also do the trick. Chuck, Thank you. I need to make some time to understand the B-splines to use them appropriately. Un

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Rich Shepard
On Fri, 25 Apr 2008, Bruce Southey wrote: > Just use a truncated distribution as these are well known: > http://en.wikipedia.org/wiki/Truncated_distribution > http://en.wikipedia.org/wiki/Truncated_normal_distribution Bruce, I considered the truncated normal distribution, but having the tails

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Anne Archibald
On 25/04/2008, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Fri, Apr 25, 2008 at 12:02 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > > I think we have discovered that there is a basic conflict > > between two behaviors: > > > >x[0] == x[0,:] > >vs. > > > >x[0][0] ==

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 12:48 PM, Rich Shepard <[EMAIL PROTECTED]> wrote: > On Fri, 25 Apr 2008, Robert Kern wrote: > > > In that case, you need to search the literature of your field for precise > > details on how to construct the curve that you want. > > Robert, > > Considering how few of us w

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 12:02 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On Fri, 25 Apr 2008, Stéfan van der Walt apparently wrote: > > Reverted in r5084. > > Thank you. > > I think we have discovered that there is a basic conflict > between two behaviors: > >x[0] == x[0,:] >vs.

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Bruce Southey
Rich Shepard wrote: > On Fri, 25 Apr 2008, Robert Kern wrote: > > >> In that case, you need to search the literature of your field for precise >> details on how to construct the curve that you want. >> > > Robert, > >Considering how few of us work in this subject area there's not much i

Re: [Numpy-discussion] "aligned" matrix / ctypes

2008-04-25 Thread Zachary Pincus
> There is one more important case, which is aligning just the beginning > of the array. Indeed -- thanks! The following should take care of that case (it's all fluff around calling aligned_empty() with a dim_alignments tuple of all 1's, and the array_alignment parameter as required): def ali

Re: [Numpy-discussion] "aligned" matrix / ctypes

2008-04-25 Thread Robert Kern
On Fri, Apr 25, 2008 at 12:07 PM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > Robert, > > Can we check this in somewhere under numpy.core? It seems very useful. Yes, but I want 1.1.0 out first before adding new features. -- Robert Kern "I have come to believe that the whole world is an e

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Jarrod Millman
On Fri, Apr 25, 2008 at 12:55 PM, David Huard <[EMAIL PROTECTED]> wrote: > > Done in r5085. I added a bunch of tests, but I'd appreciate if someone > could double check before the release. This is not the time to introduce new > bugs. > > > > Hopefully this is the end of the histogram saga. > > > >

Re: [Numpy-discussion] "aligned" matrix / ctypes

2008-04-25 Thread Robert Kern
On Fri, Apr 25, 2008 at 11:09 AM, Zachary Pincus <[EMAIL PROTECTED]> wrote: > Hello all, > > Attached is code (plus tests) for allocating aligned arrays -- I think this > addresses all the requests in this thread, with regard to allowing for > different kinds of alignment. Thanks Robert and Anne f

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Rich Shepard
On Fri, 25 Apr 2008, Robert Kern wrote: > In that case, you need to search the literature of your field for precise > details on how to construct the curve that you want. Robert, Considering how few of us work in this subject area there's not much in the way of resources. Regardless, for

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Robert Kern
On Fri, Apr 25, 2008 at 8:32 AM, Rich Shepard <[EMAIL PROTECTED]> wrote: > On Thu, 24 Apr 2008, Keith Goodman wrote: > > > A Gaussian never reaches zero. > > Keith, > >I know, and that's why I need to find another way to draw these curves. > While mathematically any 'y' value < 0.2 (the defa

Re: [Numpy-discussion] Does Unreasonable Matrix Behavior affect Scipy Sparse

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Dinesh B Vadhia apparently wrote: > where A is sparse using scipy.sparse. ... I'm now using > the latest svn and b = Ax 1. Please post a small example. 2. Do you have the *very* latest SVN (post r5084)? Cheers, Alan Isaac ___ N

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Stéfan van der Walt apparently wrote: > Reverted in r5084. Thank you. I think we have discovered that there is a basic conflict between two behaviors: x[0] == x[0,:] vs. x[0][0] == x[0,0] To my recollection, everyone has agree that the second beha

Re: [Numpy-discussion] numpy release

2008-04-25 Thread David Huard
2008/4/25 David Huard <[EMAIL PROTECTED]>: > 2008/4/24 Jarrod Millman <[EMAIL PROTECTED]>: > > > On Thu, Apr 24, 2008 at 1:22 PM, David Huard wrote: > > > Assuming we want the next version to : ignore values outside of range > > and > > > accept and return the bin edges instead of the left edges,

Re: [Numpy-discussion] numpy release

2008-04-25 Thread David Huard
2008/4/24 Jarrod Millman <[EMAIL PROTECTED]>: > On Thu, Apr 24, 2008 at 1:22 PM, David Huard wrote: > > Assuming we want the next version to : ignore values outside of range > and > > accept and return the bin edges instead of the left edges, here could be > the > > new signature for 1.1: > > h,

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Stéfan van der Walt
2008/4/25 Stéfan van der Walt <[EMAIL PROTECTED]>: > I'm starting to see Chris Barker's point; allowing x[0] is causing > more problems than it is worth. On the other hand, how would you > index into a vector (as in > http://en.wikipedia.org/wiki/Vector_(spatial)) without it? To answer my own

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Stéfan van der Walt wrote: > workaround would break x[0] == x[0,:] But there is not universal agreement that x[0] == x[0,:] is desirable. In contrast, there *is* universal agreement that x[0][0]==x[0,0] is desirable. Or so I've understood the discussion. As you know, my

[Numpy-discussion] Does Unreasonable Matrix Behavior affect Scipy Sparse

2008-04-25 Thread Dinesh B Vadhia
I had b = Ax working where A is sparse using scipy.sparse. I'm now using the latest svn and b = Ax is not working and returns garbage results. Nothing has changed except the latest svn. Any thoughts? Dinesh ___ Numpy-discussion mailing list Numpy-d

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Stéfan van der Walt
2008/4/25 Alan G Isaac <[EMAIL PROTECTED]>: > 1. This is **not** what I understood as the agreement > (and I think the current solution is bad). Reverted in r5084. Cheers Stéfan ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://proje

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Stéfan van der Walt
2008/4/25 Anne Archibald <[EMAIL PROTECTED]>: > > The agreement was: Clearly that was only the agreement in my mind. I apologise if I jumped the gun. > > a) That x[0][0] should be equal to x[0,0] and > > b) That x[0,:] should be equal to x[0] (as for ndarrays) > > > > This breaks as litt

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Jarrod Millman apparently wrote: > I would like, so I can't tell if there is anything so > uncontroversial that it would make sense to change for the > 1.1.0 release. I think it is clear from reactions that the revision r5072 to matrix behavior should NOT go into any releas

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Jarrod Millman
I was hoping to get NumPy 1.1 tagged today, but it seems very unlikely at this point. Unfortunately, I haven't followed the matrix discussion as closely as I would like, so I can't tell if there is anything so uncontroversial that it would make sense to change for the 1.1.0 release. If there is s

Re: [Numpy-discussion] "aligned" matrix / ctypes

2008-04-25 Thread Stéfan van der Walt
Robert, Can we check this in somewhere under numpy.core? It seems very useful. Stéfan 2008/4/25 Zachary Pincus <[EMAIL PROTECTED]>: > Hello all, > > Attached is code (plus tests) for allocating aligned arrays -- I think this > addresses all the requests in this thread, with regard to allowing

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Charles Doutriaux
Anne Archibald wrote: > Yes, well, it really looks unlikely we will be able to agree on what > the correct solution is before 1.1, so I would like to have something > non-broken for that release. > +1 on that! ___ Numpy-discussion mailing list Numpy-d

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Anne Archibald
On 24/04/2008, Rich Shepard <[EMAIL PROTECTED]> wrote: >Thanks to several of you I produced test code using the normal density > function, and it does not do what we need. Neither does the Gaussian > function using fwhm that I've tried. The latter comes closer, but the ends > do not reach y=

Re: [Numpy-discussion] untenable matrix behavior in SVN

2008-04-25 Thread Alan G Isaac
> 2008/4/25 Alan G Isaac <[EMAIL PROTECTED]>: >> I must have misunderstood: >> I thought the agreement was to >> provisionally return a 1d array for x[0], >> while we hashed through the other proposals. On Fri, 25 Apr 2008, Stéfan van der Walt apparently wrote: > The agreement was: > a) That x

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 10:04 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > I think the use of the term 'vector' in this > thread is becoming a bit confusing. > > An M by N matrix is a vector. (I.e., it is > an element of a vector space.) > Sure, but the important thing is the multiplication. If

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Anne Archibald
On 25/04/2008, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/4/25 Alan G Isaac <[EMAIL PROTECTED]>: > > > I must have misunderstood: > > I thought the agreement was to > > provisionally return a 1d array for x[0], > > while we hashed through the other proposals. > > The agreement was

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Stéfan van der Walt
2008/4/25 Alan G Isaac <[EMAIL PROTECTED]>: > I must have misunderstood: > I thought the agreement was to > provisionally return a 1d array for x[0], > while we hashed through the other proposals. The agreement was: a) That x[0][0] should be equal to x[0,0] and b) That x[0,:] should be equal

Re: [Numpy-discussion] "aligned" matrix / ctypes

2008-04-25 Thread Zachary Pincus
Hello all, Attached is code (plus tests) for allocating aligned arrays -- I think this addresses all the requests in this thread, with regard to allowing for different kinds of alignment. Thanks Robert and Anne for your help and suggestions. Hopefully this will be useful. The core is a fu

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Stéfan van der Walt apparently wrote: > In current SVN: > In [6]: x[0] > Out[6]: matrix([[0, 1, 2]]) I must have misunderstood: I thought the agreement was to provisionally return a 1d array for x[0], while we hashed through the other proposals. Cheers, Alan ___

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Alan G Isaac
I think the use of the term 'vector' in this thread is becoming a bit confusing. An M by N matrix is a vector. (I.e., it is an element of a vector space.) Many people use the terms "row vector" and "column vector" to refer to special matrices. What is special is *not* that they are vectors (sin

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Rich Shepard
On Fri, 25 Apr 2008, David Huard wrote: > Other suggestions for bounded bell-shaped functions that reach zero on a > finite interval: > > - Beta distribution: http://en.wikipedia.org/wiki/Beta_distribution > - Cubic B-splines:http://www.ibiblio.org/e-notes/Splines/Basis.htm Thanks, David. I'm

Re: [Numpy-discussion] Fixing #736 and possible memory leak

2008-04-25 Thread Charles R Harris
On Fri, Apr 25, 2008 at 8:27 AM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > > > > > So on and so forth. The problem is this bit of code (among others) > > > > stop_at_string = ((type == PyArray_OBJECT) || > > (type == PyArray_STRING && > >type

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread David Huard
Other suggestions for bounded bell-shaped functions that reach zero on a finite interval: - Beta distribution: http://en.wikipedia.org/wiki/Beta_distribution - Cubic B-splines:http://www.ibiblio.org/e-notes/Splines/Basis.htm 2008/4/25 Bruce Southey <[EMAIL PROTECTED]>: > Rich Shepard wrote:

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Stéfan van der Walt
2008/4/25 Alan G Isaac <[EMAIL PROTECTED]>: > > 2008/4/25 Alan G Isaac : > > >> So, if X is 2 by 2, then X[0] will be a row vector. > >> But if X is 1 by 2, then X[0] will be a scalar? > >> Ouch! > >> Bye bye generic code. > > > On Fri, 25 Apr 2008, Stefan van der Walt apparently wrote: > >

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Bruce Southey
Christopher Barker wrote: [cjop] > > Bruce Southey wrote: > >> Hi, >> I would like to use the matrix functionality but I, like others, get by >> without it. >> > > What does it lack that keeps you from using it? That's the key question? > I mainly do matrix-matrix and matrix-vector mult

Re: [Numpy-discussion] Fixing #736 and possible memory leak

2008-04-25 Thread Travis E. Oliphant
> > So on and so forth. The problem is this bit of code (among others) > > stop_at_string = ((type == PyArray_OBJECT) || > (type == PyArray_STRING && >typecode->type == PyArray_STRINGLTR) || > (type == PyArray_UNICODE) || >

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Bruce Southey
Rich Shepard wrote: >Thanks to several of you I produced test code using the normal density > function, and it does not do what we need. Neither does the Gaussian > function using fwhm that I've tried. The latter comes closer, but the ends > do not reach y=0 when the inflection point is y=0.5.

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Alan G Isaac
On Fri, 25 Apr 2008, Rich Shepard apparently wrote: > bell curves that reach y=0.0 at the ends. Just change the function you are graphing. def bell(x, xmin, xmax): if xmin < x < xmax: return density(x) return 0 Here ``density`` is whatever function you are curren

Re: [Numpy-discussion] numpy release

2008-04-25 Thread Alan G Isaac
> 2008/4/25 Alan G Isaac : >> So, if X is 2 by 2, then X[0] will be a row vector. >> But if X is 1 by 2, then X[0] will be a scalar? >> Ouch! >> Bye bye generic code. On Fri, 25 Apr 2008, Stefan van der Walt apparently wrote: > Yup. That's the current state of things. I do not understand. T

Re: [Numpy-discussion] problem with view() and strided arrays?

2008-04-25 Thread Zachary Pincus
Hi all, > Actually -- it seems like view() doesn't work with strided arrays at > all. (?) > > In : a = numpy.ones((4,32), dtype=numpy.uint8) > > In : a.view(numpy.uint16).shape > Out: (4, 16) > > In : a[:,:16].view(numpy.uint16) > ValueError: new type not compatible with array. > > I think this mi

Re: [Numpy-discussion] Generating Bell Curves (was: Using normal() )

2008-04-25 Thread Rich Shepard
On Thu, 24 Apr 2008, Keith Goodman wrote: > A Gaussian never reaches zero. Keith, I know, and that's why I need to find another way to draw these curves. While mathematically any 'y' value < 0.2 (the default) is equivalent to zero, the curves must reach zero in the figures. Briefly, this

Re: [Numpy-discussion] insert 1D to a 2D array and change it to 3D

2008-04-25 Thread lorenzo bolla
why not using something like numpy.repeat? In [18]: B = numpy.random.rand(4,3) In [19]: A = numpy.repeat(B[:,:,numpy.newaxis],2,axis=2) In [20]: B.shape Out[20]: (4, 3) In [21]: A.shape Out[21]: (4, 3, 2) In [22]: numpy.all(A[:,:,0] == A[:,:,1]) Out[22]: True hth, L. On Fri, Apr 25, 2008 at 12:

Re: [Numpy-discussion] insert 1D to a 2D array and change it to 3D

2008-04-25 Thread Matthieu Brucher
2008/4/25, tournesol <[EMAIL PROTECTED]>: > > Hi All. > > > I just want to conver Fortran 77 source to > Python. > > Here is my F77 source. > > DIMENSION A(25,60,13),B(25,60,13) > > open(15,file='data.dat') > DO 60 K=1,2 > READ(15,1602) ((B(I,J),J=1,60),I=1,25) >

[Numpy-discussion] insert 1D to a 2D array and change it to 3D

2008-04-25 Thread tournesol
Hi All. I just want to conver Fortran 77 source to Python. Here is my F77 source. DIMENSION A(25,60,13),B(25,60,13) open(15,file='data.dat') DO 60 K=1,2 READ(15,1602) ((B(I,J),J=1,60),I=1,25) 60 CONTINUE 1602 FORMAT(15I4) DO 63 K=1,10 DO 6

Re: [Numpy-discussion] OSX installer: please test

2008-04-25 Thread David Cournapeau
On Fri, 2008-04-25 at 11:17 +0200, Sebastian Haase wrote: > OT: How do you make a dmg ? Is there a (simple) command line tool for this ? .dmg is just an iso 9660 file (e.g. a CD "fs"), which is recognized by Mac OS X as such. It really is not different than mounting an iso on any unix (you can mo

Re: [Numpy-discussion] OSX installer: please test

2008-04-25 Thread Sebastian Haase
OT: How do you make a dmg ? Is there a (simple) command line tool for this ? Thanks, Sebastian Haase On Wed, Apr 23, 2008 at 9:46 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > Christopher Burns wrote: > > I've built a Universal Mac binary for numpy 1.1.0. If > > > Mac pe