Re: [Numpy-discussion] TypeError: 'module' object is not callable

2010-01-12 Thread Arnar Flatberg
On Tue, Jan 12, 2010 at 4:11 PM, Jankins wrote: Hi On my Ubuntu, I would reach the arpack wrapper as follows: from scipy.sparse.linalg.eigen.arpack import eigen However, I'd guess that you deal with a symmetric matrix (Laplacian or adjacency matrix), so the symmetric solver might be the best c

Re: [Numpy-discussion] profiling line by line

2008-09-29 Thread Arnar Flatberg
On Sat, Sep 27, 2008 at 2:36 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg <[EMAIL PROTECTED]> > wrote: > > > > On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern <[EMAIL PROTECTED]> > wrote: > > There is now

Re: [Numpy-discussion] Fw: array indices and dictionary

2008-09-21 Thread Arnar Flatberg
On Sun, Sep 21, 2008 at 7:51 PM, Dinesh B Vadhia <[EMAIL PROTECTED]>wrote: > Ooops, I should have said that this is easy to do with 2 for loops ie. > > import numpy > from collections import defaultdict > A = > [[1 6 1 2 3] > [4 5 4 7 0] > [2 0 8 0 2] > [0 0 0 3 7] > [0 7 0 3 5] > [8 0 3 0 6

Re: [Numpy-discussion] which one is best?

2008-09-19 Thread Arnar Flatberg
On Fri, Sep 19, 2008 at 4:09 PM, lorenzo <[EMAIL PROTECTED]> wrote: > > > On Fri, Sep 19, 2008 at 2:50 PM, Arnar Flatberg <[EMAIL PROTECTED]>wrote: > >> >> >> I think >> [x*y for x in a for y in b] >> feels pythonic, however it has a surpri

Re: [Numpy-discussion] which one is best?

2008-09-19 Thread Arnar Flatberg
On Fri, Sep 19, 2008 at 3:09 PM, Stéfan van der Walt <[EMAIL PROTECTED]>wrote: > 2008/9/19 mark <[EMAIL PROTECTED]>: > > I need to multiply items in a list and need a list back. Which one of > > the four options is best (I thought in Python there was only one way > > to do something???) > > With t

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Arnar Flatberg
On Wed, Sep 17, 2008 at 10:33 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Sep 17, 2008 at 07:12, Arnar Flatberg <[EMAIL PROTECTED]> > wrote: > > > > On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern <[EMAIL PROTECTED]> > wrote: > > It should be s

Re: [Numpy-discussion] profiling line by line

2008-09-17 Thread Arnar Flatberg
On Wed, Sep 17, 2008 at 3:56 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > > So, I could use some comments on the workflow. Does this look sensible > to everyone? How else would you like to use it? > Works for me. I would love to use it as a part of an ipython session. Initially, I sprinkled som $

Re: [Numpy-discussion] profiling line by line

2008-09-15 Thread Arnar Flatberg
On Mon, Sep 15, 2008 at 5:18 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > I do have some Cython code that > does this. It needs a little bit more work, though. I'll try to push > it out soonish. > That would make me an extremely happy user, I've been looking for this for years! I can't imagine I'

[Numpy-discussion] Change of SVD output

2008-07-25 Thread Arnar Flatberg
Hi In a recent thread there was an error in how a matrix is reconstructed from its SVD decomposition. I apologize if this is just an old and settled issue and I am just adding noise, but I got bitten by numpy's unfamiliar output myself a long time ago and I see others get confused as well. So what

Re: [Numpy-discussion] curious problem with SVD

2008-07-25 Thread Arnar Flatberg
On Fri, Jul 25, 2008 at 9:39 PM, Keith Goodman <[EMAIL PROTECTED]> wrote: > On Fri, Jul 25, 2008 at 12:36 PM, Keith Goodman <[EMAIL PROTECTED]> > wrote: > > On Fri, Jul 25, 2008 at 12:32 PM, Frank Lagor <[EMAIL PROTECTED]> > wrote: > >> Perhaps I do not understand something properly, if so could s

Re: [Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Arnar Flatberg
On Fri, Jul 18, 2008 at 12:38 PM, Arnar Flatberg <[EMAIL PROTECTED]> wrote: > > > On Fri, Jul 18, 2008 at 11:40 AM, Stéfan van der Walt <[EMAIL PROTECTED]> > wrote: > >> 2008/7/18 Arnar Flatberg <[EMAIL PROTECTED]>: >> > I need to check if my array

Re: [Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Arnar Flatberg
On Fri, Jul 18, 2008 at 11:40 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/7/18 Arnar Flatberg <[EMAIL PROTECTED]>: > > I need to check if my array (a) is of type `string`. That is, I dont know > > the number of characters beforehand, so I cant do a.d

[Numpy-discussion] Type checking of arrays containing strings

2008-07-18 Thread Arnar Flatberg
Hi I need to check if my array (a) is of type `string`. That is, I dont know the number of characters beforehand, so I cant do a.dtype == '|S*' (* = (max) number of characters) Looking at my options, I see either a.dtype.kind == 'S' or a.dtype.type == np.string_, might be ok. Are these any of the

Re: [Numpy-discussion] confusion about eigenvector

2008-03-03 Thread Arnar Flatberg
> This will not work with numpy matrices.* is elementwise mult. Sorry, disregard that comment ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] confusion about eigenvector

2008-03-03 Thread Arnar Flatberg
> i read in some document on the topic of eigenfaces that > 'Multiplying the sorted eigenvector with face vector results in > getting the > face-space vector' > facespace=sortedeigenvectorsmatrix * adjustedfacematrix > (when these are numpy.matrices ) This will not work with numpy matrices.

Re: [Numpy-discussion] svd() and eigh()

2008-03-01 Thread Arnar Flatberg
On Sat, Mar 1, 2008 at 2:43 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > i have a set of images of faces which i make into a 2d array using > numpy.ndarray > each row represents a face image > faces= > [[ 173. 87. ... 88. 165.] > [ 158. 103. .. 73. 143.] > [ 180. 87

Re: [Numpy-discussion] confusion about eigenvector

2008-03-01 Thread Arnar Flatberg
On Sat, Mar 1, 2008 at 8:27 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > This example assumes that facearray is an ndarray.(like you described > > in original post ;-) ) It looks like you are using a matrix. > > hi Arnar > thanks .. > a few doubts however > > 1.when i use say 10 ima

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread Arnar Flatberg
On Thu, Feb 28, 2008 at 3:41 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Arnar wrote > > > from scipy import linalg > > facearray-=facearray.mean(0) #mean centering > > u, s, vt = linalg.svd(facearray, 0) > > scores = u*s > > facespace = vt.T > > hi Arnar > when i do this i get these

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread Arnar Flatberg
On Thu, Feb 28, 2008 at 8:17 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i all > I am learning PCA method by reading up Turk&Petland papers etc > while trying out PCA on a set of greyscale images using python, and > numpy I tried to create eigenvectors and facespace. > > i have > faces

Re: [Numpy-discussion] Optimizing speed for large-array inter-element algorithms (specifically, color space conversion)

2008-01-21 Thread Arnar Flatberg
Hi Theodore Probably not the fastest, but a full example of how you may vectorize your loop. Ran just one test, and that speeded up the original code. Example: from numpy import empty_like def vectorized_rgb2hsv(im): "im is a (m, n, 3) array.""" im = im/255. out = e

Re: [Numpy-discussion] GPU blas with numpy?

2007-12-06 Thread Arnar Flatberg
Hi Jon Have you looked at pystream? http://code.google.com/p/pystream/ Arnar On Dec 6, 2007 12:39 PM, Jon Wright <[EMAIL PROTECTED]> wrote: > Hello, > > Does anyone have any experience with numpy and using a GPU? eg: > > http://developer.nvidia.com/object/cuda.html > > ...they seem to have a GPU

Re: [Numpy-discussion] Segfault on wrong use of indexing

2007-09-17 Thread Arnar Flatberg
ious issue (I see Gutsy uses 1.0.3). I have tested this behavior on three machines running Ubunut Feisty with similar result. On 9/17/07, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > Arnar Flatberg wrote: > > However, when I tried to to insert a 1-dim array with a 'two-di

[Numpy-discussion] Segfault on wrong use of indexing

2007-09-17 Thread Arnar Flatberg
Hi list A pretty common use (for me) is to create arrays at the beginning of my code and then fill in parts as I go along. Today, my code hit a segmentation fault. The error was that an index-vector ,that usually is a list with several members, now contained only one member and I tried to insert a