On 11/12/06, Pierre GM <[EMAIL PROTECTED]> wrote:
> On Sunday 12 November 2006 17:08, A. M. Archibald wrote:
> > On 12/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> > > Is anybody interested in making x.max() and nanmax() behave the same
> > > for mat
On 11/14/06, Erin Sheldon <[EMAIL PROTECTED]> wrote:
> As an aside, your database is running on a local disk, right, so
> the overehead of retrieving data is minimized here?
> For my tests I think I am data retrieval limited because I
> get exactly the same time for the equivalent of retrieve1
> a
On 11/14/06, Jeff Strunk <[EMAIL PROTECTED]> wrote:
> Good afternoon,
>
> We will be performing the migration of this mailing list from Sourceforge to
> SciPy on Thursday at 2pm central.
>
> After this time, the new mailing list address will be
> [EMAIL PROTECTED] . Any mail sent to the Sourceforge
Is anybody interested in making x.max() and nanmax() behave the same
for matrices, except for the NaN part? That is, make
numpy.matlib.nanmax return a matrix instead of an array.
Example
=
>> import numpy.matlib as M
>> x = M.rand(3,2)
>> x.max(0)
matrix([[ 0.91749823, 0.94942954]])
>> M.n
On 11/12/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> >> x = M.matrix([[1, 2], [3, 4]])
> >> x
> matrix([[1, 2],
> [3, 4]])
>
> >> y = M.matrix([[5], [6]])
> >> y
> matrix([[5],
> [6]])
>
> >> idx =
>> x = M.matrix([[1, 2], [3, 4]])
>> x
matrix([[1, 2],
[3, 4]])
>> y = M.matrix([[5], [6]])
>> y
matrix([[5],
[6]])
>> idx = M.where(x[:,0].A < 100)[0]
>> idx
array([0, 1])
>> x[idx,0] # < This works
matrix([[1],
[3]])
>> x[idx,0] = y# < But this doesn't w
On 11/12/06, George Sakkis <[EMAIL PROTECTED]> wrote:
> This must be pretty trivial but I couldn't find it in the docs: what's
> the "numpythonic" way to find the (first) index of an element, i.e. the
> equivalent to list.index ?
Does where work?
--
On 11/11/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > How about a nanmin() function?
>
> Already there.
>
> In [2]: nanmin?
> Type: function
> Base Class:
> Namespace: Interactive
> File:
> /Library/Frameworks/P
On 11/11/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Barring a clever solution (at least cleverer than I feel like being
> immediately), the way to solve this would be to check for nans in the array
> and
> deal with them separately (or simply ignore them in the case of x.min()).
> However, this
x.min() and x.max() depend on the ordering of the elements:
>> x = M.matrix([[ M.nan, 2.0, 1.0]])
>> x.min()
nan
>> x = M.matrix([[ 1.0, 2.0, M.nan]])
>> x.min()
1.0
If I were to try the latter in ipython, I'd assume, great, min()
ignores NaNs. But then the former would be a bug in my program.
On 11/11/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:
> On Sat, Nov 11, 2006 at 10:40:22AM -0800, Keith Goodman wrote:
> > I accidentally wrote a unit test using int32 instead of float64 and
> > ran into this problem:
> >
> > >> x = M.matrix([[1,
I accidentally wrote a unit test using int32 instead of float64 and
ran into this problem:
>> x = M.matrix([[1, 2, 3]])
>> x[0,1] = M.nan
>> x
matrix([[1, 0, 3]]) <--- Got 0 instead of NaN
But this, of course, works:
>> x = M.matrix([[1.0, 2.0, 3.0]])
>> x[0,1] = M.nan
>> x
matrix([[ 1.
On 11/8/06, izak marais <[EMAIL PROTECTED]> wrote:
> Sorry if this is an obvious question, but what is the easiest way to
> multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator
> apparently does element wise multiplication, as does the 'multiply' ufunc.
> All I could find w
On 11/1/06, David Cournapeau <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to generate some random integers,let's say in the range [-
> 2^15, 2^16]. Why doing:
>
> noise = numpy.random.random_integers(- (2 ** 15), (2 * 15), 22050)
>
> gives only negative numbers ?
I guess 2^15 is too big
On 11/1/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> It looks like 1.0-x is doing the right thing.
>
> The problem is 1.0*x for matrices is going to float64. For arrays it
> returns float32 just like the 1.0-x
>
> This can't be changed at this point until 1.1
>
> We will fix the bug in 1.0*x p
I had a hard time tracing a bug in my code. The culprit was this difference:
>> x
matrix([[True],
[True],
[True]], dtype=bool)
>> 1.0 - x
matrix([[ 0.],
[ 0.],
[ 0.]], dtype=float32) <--- float32
>> 1.0*x
matrix([[ 1.],
[ 1.],
[ 1.]])
On 10/27/06, jeremito <[EMAIL PROTECTED]> wrote:
> I am using a = numpy.linalg.eig(A) to get the eigenvalues and
> eigenvectors. I am interested only in the largest eigenvalue so I
> would like to sort the first element of a. But if I do that, I won't
> know what is the associated eigenvector. I
Is there any guarantee on the order of eigenvalues (and eigenvectors)
returned by numpy.linalg.eigh?
If I want to make sure the eigenvalues are in ascending order of
magnitude should I sort them myself?
-
Using Tomcat but nee
On 10/23/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > On 10/20/06, JJ <[EMAIL PROTECTED]> wrote:
> >
> >> My suggestion is to
> >> create a new attribute, such as .AR, so that the
> >> following could be used:
On 10/22/06, Aric Hagberg <[EMAIL PROTECTED]> wrote:
> On Sat, Oct 21, 2006 at 02:05:42PM -0700, Keith Goodman wrote:
> > Did you, or anybody else on the list, have any luck making a numpy
> > version of eigs?
>
> I made a start at an ARPACK wrapper, see
> http://
On 8/15/06, David Grant <[EMAIL PROTECTED]> wrote:
> My idea is (if I have time) to write an eigs-like function in python
> that will only perform a subset of what Matlab's eigs does for. It
> will, for example, compute a certain number of eigenvalues and
> eigenvectors for a real, sparse, symmetr
On 10/20/06, JJ <[EMAIL PROTECTED]> wrote:
> My suggestion is to
> create a new attribute, such as .AR, so that the
> following could be used: M[K.AR,:]
It would be even better if M[K,:] worked. Would such a patch be
accepted? (Not that I know how to make it.)
On 10/18/06, Christopher Hanley <[EMAIL PROTECTED]> wrote:
> I can't decide if the following is a bug or feature. Numpy scalars are
> allowed to overflow silently while numarray upcasts to a larger python
> type. I guess my biggest problem is that the overflow occurs silently.
I had that problem
On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> This works:
>
> >> M.asmatrix(['a', 'b', None])
> matrix([[a, b, None]], dtype=object)
>
> But this doesn't:
>
> >> M.asmatrix(['a', 'b', None, 'c
This works:
>> M.asmatrix(['a', 'b', None])
matrix([[a, b, None]], dtype=object)
But this doesn't:
>> M.asmatrix(['a', 'b', None, 'c'])
TypeError: expected a readable buffer object
>> M.__version__
'1.0rc1'
It also doesn't work for asarray and for tuples.
-
On 10/9/06, Eric Emsellem <[EMAIL PROTECTED]> wrote:
> thanks for the pointer to pida. I installed it successfully but I didn't
> manage to
> makeit really work [snip]
I was excited to see that pida can use meld. But when I try to do a
diff, pida complains that it cannot find meldembed.py. Has a
NaN adds a lot of whitespace in the representation of a matrix.
Without NaN:
matrix([[1, 2],
[3, 4]])
With NaN:
matrix([[ nan,2.],
[ 3.,4.]])
There's enough room for the wikipedia entry for nan.
---
I like the salutation of the letter below: "Please read this letter
attentively!"
Why does so much spam make it through the sourceforge filters?
Or maybe they only let through the very good deals. "You will earn
from 1500 up to 3000 USD per week, working only some hours per day."
On Wed, 20 Sep
On 9/19/06, A. M. Archibald <[EMAIL PROTECTED]> wrote:
> On 19/09/06, Tim Hochberg <[EMAIL PROTECTED]> wrote:
> > Keith Goodman wrote:
> > > In what order would you like argsort to sort the values -inf, nan, inf?
> > >
> > Ideally, -inf should so
In what order would you like argsort to sort the values -inf, nan, inf?
In numpy 1.0b1 nan is always left where it began:
EXAMPLE 1
>> x
matrix([[ inf],
[ -inf],
[ nan]])
>> x[x.argsort(0),:]
matrix([[ -inf],
[
I plan to build an amd64 box and run debian etch. Are there any big,
64-bit, show-stopping problems in numpy? Any minor annoyances?
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done qui
On 8/29/06, Mathew Yeates <[EMAIL PROTECTED]> wrote:
> I have an M by N array of floats. Associated with the columns are
> character labels
> ['a','b','b','c','d','e','e','e'] note: already sorted so duplicates
> are contiguous
>
> I want to replace the 2 'b' columns with the sum of the 2 columns
On 8/29/06, Torgil Svensson <[EMAIL PROTECTED]> wrote:
> something like this?
>
> def list2index(L):
>uL=sorted(set(L))
>idx=dict((y,x) for x,y in enumerate(uL))
>return uL,asmatrix(fromiter((idx[x] for x in L),dtype=int))
Wow. That's amazing. Thank you.
--
On 8/29/06, Tim Hochberg <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > I have a very long list that contains many repeated elements. The
> > elements of the list can be either all numbers, or all strings, or all
> > dates [datetime.date].
> >
> > I
I have a very long list that contains many repeated elements. The
elements of the list can be either all numbers, or all strings, or all
dates [datetime.date].
I want to convert the list into a matrix where each unique element of
the list is assigned a consecutive integer starting from zero.
I've
randn incorrectly returns random numbers only between 0 and 1 in numpy
1.0b1. random.randn works.
>> from numpy.matlib import *
>> randn(3,4)
matrix([[ 0.60856413, 0.35500732, 0.48089868, 0.7044022 ],
[ 0.71098538, 0.8506885 , 0.56154652, 0.4243273 ],
[ 0.89655777, 0.92339
On 8/26/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> On 8/26/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
>
> >
> > I've come up with adding the functions (not methods at this point)
> >
> > deletefrom
> > insertinto
>
>
> "delete" and "insert" really would be better. The current "insert"
> fun
On 8/25/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> I've come up with adding the functions (not methods at this point)
>
> deletefrom
> insertinto
>
> appendto (syntatic sugar for concatenate but with a separate argument
> for the array and the extra stuff) --- is this needed?
>
> These func
How do I delete a row (or list of rows) from a matrix object?
To remove the n'th row in octave I use x(n,:) = []. Or n could be a
vector of rows to remove.
In numpy 0.9.9.2813 x[[1,2],:] = [] changes the values of all the
elements of x without changing the size of x.
In numpy do I have to turn i
On 8/15/06, David Grant <[EMAIL PROTECTED]> wrote:
> My idea is (if I have time) to write an eigs-like function in python
> that will only perform a subset of what Matlab's eigs does for. It
> will, for example, compute a certain number of eigenvalues and
> eigenvectors for a real, sparse, symmetr
Every time I want to make a diagonal matrix from a vector I have to do
a google search. So I'm with you Sven:
diag(NxN matrix) should return a Nx1 matrix
diag(Nx1 or 1xN matrix) should return a NxN matrix
instead of the current behavior:
diag(NxN matrix) returns an array
diag(Nx1 matrix) returns
On 7/18/06, Thomas Heller <[EMAIL PROTECTED]> wrote:
> When I change this line in the generated config.h file:
>
> #define NPY_ALLOW_THREADS WITH_THREAD
>
> to this one:
>
> #define NPY_ALLOW_THREADS 1
>
> then I can build.
What part of numpy is threaded?
On 7/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > How do you display all of the rows of a matrix?
> >
>
> help(numpy.set_prinoptions)
That is great! Now I can change the precision as well. Eight
significant figures is too precise for me.
How do you display all of the rows of a matrix?
>> x = zeros((334,3))
>> x
matrix([[ 0., 0., 0.],
[ 0., 0., 0.],
[ 0., 0., 0.],
...,
[ 0., 0., 0.],
[ 0., 0., 0.],
[ 0., 0., 0.]])
-
On 7/16/06, Rick White <[EMAIL PROTECTED]> wrote:
> On Jul 16, 2006, at 11:47 AM, Alan G Isaac wrote:
>
> > On Sun, 16 Jul 2006, "David M. Cooke" apparently wrote:
> >> 'inverse' is not much longer than 'inv', and is more descriptive
> >
> > But 'inv' is quite universal (can you name a matrix langu
On 7/15/06, Steve Lianoglou <[EMAIL PROTECTED]> wrote:
> 1) Did you install ubuntu by way of Parallels, or are you running
> linux "full steam"
Yes, it is a full steam dual boot system. My default boot is Ubuntu.
> 2) If you did install ubuntu alongside/over/whatever mac os x and
> didn't use pa
Is there much speed to be gained by compiling atlas for a dual core system?
I'm running Ubuntu on a Macbook. It's the first time I've had a dual
core system.
My one line benchmark shows that the Macbook is slow compared to my
(old) desktop.
>> t1=time.time();x=randn(500,1000);x =
x*x.T;a,b=linal
On 7/14/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> On 7/15/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> > Nils Wagner wrote:
> >
> > > >>> p = linalg.pinv(a)
> > > Traceback (most recent call last):
> > > File "", line 1, in ?
> > > File "/usr/lib64/python2.4/site-packages/numpy/linalg/linal
On 7/11/06, David Huard <[EMAIL PROTECTED]> wrote:
>
>
> 2006/7/11, JJ <[EMAIL PROTECTED]>:
> > 1) is it possible to get the function unique() to work with matrices,
> perhaps
> > with a unique_rows() function to work with matrices of more than one
> column?
>
>
> The problem is that applying uniqu
On 7/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> JJ wrote:
> >4) It would be nice if the linear algebra package and other packages returned
> >matrices if given matrices. For example, if M is a matrix, svd(M) now
> >returns
> >
> >
> Svd returns matrices now. Except for the list of singu
On 7/7/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> a numpy.matlib module was started to store matrix versions of the
> standard array-creation functions and mat was re-labeled to "asmatrix"
> so that a copy is not made by default.
Holy crap! It works. This is great. Thank you.
>> import nu
On 7/9/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> Thanks for the reply Keith.
>
>
> On 7/10/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> > One quick hack is to install the new numpy somewhere else and then
> > rename the directory containing 0.9.8 to numpyST
On 7/9/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> I got numpy compiled according the the instruction on the Wiki, but is there
> some way to try it out without wiping out my stable install of 0.9.8?
>
> I tried modifying my PYTHONPATH to put the new numpy build directory first,
> but 'import nump
On 7/7/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Bill Baxter wrote:
> > 4) eye,empty,rand,ones,zeros,arange and anything else that builds an
> > array from scratch or from a python list should have a matrix equivalent
> Would
>
> from numpy.defmatrix import ones, zeros, ...
>
> work?
Can de
On 7/7/06, Ed Schofield <[EMAIL PROTECTED]> wrote:
> I'd like to help to make matrices more usable. Tell me what you want,
> and I'll work on some patches.
I can't pass up an offer like that.
DIAG
diag(M) returns an array. It would be nice if diag(M) returned
asmatrix(diag(M)).T. It would als
On 7/6/06, Mathew Yeates <[EMAIL PROTECTED]> wrote:
> okay, I went back to the binary windows distrib. Based on Keths code I wrote
>
> >> print numpy.asmatrix(all_dates == start_dates[row],dtype=int)
> [[0 0 0 0 0 0 0 0 0 0 0 1 0 0]]
> >> [row,numpy.asmatrix(all_dates == start_dates[row],dtype=in
On 7/6/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Mathew Yeates wrote:
>
> >Not working.
> >A[row,all_dates == 10] = -1 where all_dates is a matrix with column
> >length of 14 [[960111,..,..
> >and A is a matrix with same column length
> >
> >I get
> >IndexError: arrays used as indices must b
On 7/6/06, Sven Schreiber <[EMAIL PROTECTED]> wrote:
> Maybe you guys as the developers of numpy should really make up your
> mind about the future of matrices in numpy. Either it's supported, then
> eventually I would expect matrix versions of ones, zeros, eye, for
> example. (Although eye().M wo
On 7/5/06, Mathew Yeates <[EMAIL PROTECTED]> wrote:
> What is the typical way of doing the following
> starting with a 0 matrix, set all values to 1 when a certain condition
> is met, set to -1 when another condition is met, left alone if neither
> condition is met.
This works on recent versions o
On 7/4/06, Pau Gargallo <[EMAIL PROTECTED]> wrote:
> motivated by the lack of free documentation for NumPy, with some
> friends, we started writing a tutorial, that we would like to see in
> scipy.org. After some time, the project have started to loose its
> initial impetus. Now, we put the curren
On 7/2/06, Webb Sprague <[EMAIL PROTECTED]> wrote:
> Given the long history of python and its ancestry in C (for which zero
> based indexing made lots of sense since it dovetailed with thinking in
> memory offsets in systems programming), there is probably nothing to
> be done now. I guess I just
I have a list x
>> x
[[1, None], [2, 3]]
that I generate outside of numpy (with plain python). What is the best
way to convert x into an array? This doesn't work
>> asarray(x)
array([[1, None],
[2, 3]], dtype=object) <-- I'm hoping for something like dtype=float64
Is there something b
On 6/30/06, David M. Cooke <[EMAIL PROTECTED]> wrote:
> On Fri, 30 Jun 2006 13:37:01 -0700
> "Keith Goodman" <[EMAIL PROTECTED]> wrote:
>
> > When an array is printed, the numbers line up in nice columns (if
> > you're using a fixed-widt
When an array is printed, the numbers line up in nice columns (if
you're using a fixed-width font):
array([[0, 0],
[0, 0]])
But for matrices the columns do not line up:
matrix([[0, 0],
[0, 0]])
Using Tomcat but need to do more? Need to support web services, security?
Get stuff don
On 6/30/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Tim Hochberg wrote:
> > Regarding choice of float or int for default:
> >
> > The number one priority for numpy should be to unify the three disparate
> > Python numeric packages. Whatever choice of defaults facilitates that is
> > what I support
On 6/30/06, Sasha <[EMAIL PROTECTED]> wrote:
> On 6/30/06, Fernando Perez <[EMAIL PROTECTED]> wrote:
> > ...
> > Besides, decent unit tests will catch these problems. We all know
> > that every scientific code in existence is unit tested to the smallest
> > routine, so this shouldn't be a problem
On 6/29/06, Alan G Isaac <[EMAIL PROTECTED]> wrote:
> On Thu, 29 Jun 2006, Travis Oliphant apparently wrote:
> > Please make any comments or voice major concerns
>
> A rather minor issue, but I would just like to make sure
> that a policy decision was made not to move to a float
> default for ident
On 6/29/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> Rand at least returns doubles:
>
> >>> num.rand(3,3).dtype.name
> 'float64'
Then I vote float64.
>> linalg.eigh(asmatrix(1))[0].dtype.name
'float64'
>> linalg.cholesky(asmatrix(1)).dtype.name
'float64'
Using Tomcat but need to do more? Need t
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? What does rand, eigh,
lstsq, etc return?
Using Tomcat but need to do more? Need to support web services, secur
On 6/29/06, Alan G Isaac <[EMAIL PROTECTED]> wrote:
> On Thu, 29 Jun 2006, Travis Oliphant apparently wrote:
> > Please make any comments or voice major concerns
>
> A rather minor issue, but I would just like to make sure
> that a policy decision was made not to move to a float
> default for ident
On 6/28/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> This should be better behaved now in SVN. Thanks for the reports.
I'm impressed by how quickly features are added and bugs are fixed.
And by how quick it is to install a new version of numpy.
Thank you.
Using Tomcat but need to do more? N
On 6/28/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
>
> >On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote:
> >
> >
> >>i don't know why 'where' is returning matrices.
> >>if you use:
> >>
On 6/28/06, Pau Gargallo <[EMAIL PROTECTED]> wrote:
> i don't know why 'where' is returning matrices.
> if you use:
>
> >>> idx = where(y.A > 0.5)[0]
>
> everything will work fine (I guess)
What about the second issue? Is this expected behavior?
>> idx
array([0, 1, 2])
>> y
matrix([[ 0.63731308
>> x = asmatrix(rand(3,2))
>> y = asmatrix(rand(3,1))
>> y
matrix([[ 0.77952062],
[ 0.97110465],
[ 0.77450218]])
>> idx = where(y > 0.5)[0]
>> idx
matrix([[0, 1, 2]])
>> x[idx,:]
matrix([[ 0.24837887, 0.52988253],
[ 0.28661085, 0.43053076],
[ 0.05360893, 0.2266
On 6/27/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > Isn't the Cholesky decomposition by convention an upper triangular
> > matrix? I noticed, by porting Octave code, that linalg.cholesky
> > returns the lower triangular matrix.
Isn't the Cholesky decomposition by convention an upper triangular
matrix? I noticed, by porting Octave code, that linalg.cholesky
returns the lower triangular matrix.
References:
http://mathworld.wolfram.com/CholeskyDecomposition.html
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/cho
On 6/27/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> On 6/27/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
>
> > The numpy.dual library exists so you can use the SciPy calls if the
> > person has SciPy installed or the NumPy ones otherwise. It exists
> > pre
On 6/27/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> The numpy.dual library exists so you can use the SciPy calls if the
> person has SciPy installed or the NumPy ones otherwise. It exists
> precisely for the purpose of seamlessly taking advantage of
> algorithms/interfaces that exist in NumP
On 6/27/06, Dennis V. Perepelitsa <[EMAIL PROTECTED]> wrote:
> I've run some benchmarks comparing the performance of scipy, numpy,
> Numeric and numarray vs. MATLAB.
I enjoyed looking at the results.
The most interesting result, for me, was that inverting a matrix is
much faster in scipy than nu
On 6/27/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > This works in numpy 0.9.7.2416 but doesn't work in numpy 0.9.9.2683:
> >
> > Numpy 0.9.9.2683
> >
> > x = asmatrix(zeros((3,2), float))
> > y = asma
This works in numpy 0.9.7.2416 but doesn't work in numpy 0.9.9.2683:
Numpy 0.9.9.2683
x = asmatrix(zeros((3,2), float))
y = asmatrix(rand(3,1))
y
matrix([[ 0.49865026],
[ 0.82675808],
[ 0.30285247]])
x[:,1] = y > 0.5
x
matrix([[ 0., 0.],
[ 0., 0.], <--- this should be o
Upgrading numpy and scipy from an April svn snapshot to yesterday's
svn broke my code.
To diagnose the problem I need to generate data in one version and
load it in the other version.
I did a search on how to save data in python and came up with pickle,
or, actually, cpickle.
But the format of t
On 6/22/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > How do I seed rand and randn?
>
> If you can, please use the .rand() and .randn() methods on a RandomState
> object
> which you can initialize with whatever seed you like.
>
> In [1]
On 6/23/06, Mathew Yeates <[EMAIL PROTECTED]> wrote:
>
> >
> > I'm porting by hand. It does not seem easy to me. And even if it were
> Ah. Do I detect a dare? Could start first by using Octaves matlab parser.
(Let me help you recruit people to do the work)
"There is no way in the world that this
On 6/23/06, Mathew Yeates <[EMAIL PROTECTED]> wrote:
> This is probably in an FAQ somewhere but .
>
> Is there a tool out there for translating Matlab to Numeric? I found a
> 1999 posting by Travis asking the same thing! It doesn't seem like it
> would be all THAT difficult to write.
I'm porti
On 6/23/06, Sven Schreiber <[EMAIL PROTECTED]> wrote:
> Keith Goodman schrieb:
> > How do I make a NxN diagonal matrix with a Nx1 column vector x along
> > the diagonal?
> >
>
> >>> help(n.diag)
> Help on function diag in module numpy.lib.twodim_
How do I make a NxN diagonal matrix with a Nx1 column vector x along
the diagonal?
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 IBM WebSphere Application Server v.1.0.1 based on Apac
On 6/22/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > How do I seed rand and randn?
>
> If you can, please use the .rand() and .randn() methods on a RandomState
> object
> which you can initialize with whatever seed you like.
>
> In [1]
How do I seed rand and randn?
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 IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&k
On 6/22/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> 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 othe
On 6/22/06, Jocelyn E. Renner <[EMAIL PROTECTED]> wrote:
> python setup.py install
>
> when I was in the numarray directory. When I executed this, I received
> the following error message:
> error: could not create
> '/System/Library/Frameworks/Python.framework/Versions/2.3/include/
> python2.3/n
On 6/21/06, Robert Kern <[EMAIL PROTECTED]> wrote:
> Keith Goodman wrote:
> > The NumPy for Matlab Users page suggests mat(a.A * b.A) for
> > element-by-element matrix multiplication. I think it would be helpful
> > to also include multiply(a, b).
> >
&
The NumPy for Matlab Users page suggests mat(a.A * b.A) for
element-by-element matrix multiplication. I think it would be helpful
to also include multiply(a, b).
a.*b
mat(a.A * b.A) or
multiply(a, b)
___
Numpy-discussion mailing list
Numpy-discussion@
Alan G Isaac wrote:
> M.transpose()[V>0]
> If you want the columns as columns,
> you can transpose again.
I can't get that to work when M is a n by m matrix:
>> M = asmatrix(rand(3,4))
>> M
matrix([[ 0.78970407, 0.78681448, 0.79167808, 0.57857822],
[ 0.44567836, 0.23985597, 0.49392
On 6/20/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> >>> a[:,num.where(v>0.5)[0]]
> array([[1, 2, 4],
>[6, 7, 9]])
>
> I'll put that up on the Matlab->Numpy page.
That's a great addition to the Matlab to Numpy page.
But it only works if v is a column vector. If v is a row vector, then
wh
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]])
> >>> v = num.r
I have a matrix M and a vector (n by 1 matrix) V. I want to form a new
matrix that contains the columns of M for which V > 0.
One way to do that in Octave is M(:, find(V > 0)). How is it done in numpy?
___
Numpy-discussion mailing list
Numpy-discussion
97 matches
Mail list logo