Re: [Numpy-discussion] ANN: Numexpr 2.0.1 released

2012-01-08 Thread Nadav Horesh
What about python3 support? Thanks Nadav. From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Francesc Alted [fal...@gmail.com] Sent: 08 January 2012 12:49 To: Discussion of Numerical Python; numexpr Subject:

Re: [Numpy-discussion] Counting the Colors of RGB-Image

2012-01-15 Thread Nadav Horesh
im_flat = im0[...,0]*65536 + im[...,1]*256 +im[...,2] colours = np.unique(im_flat) Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Tony Yu [tsy...@gmail.com] Sent: 15 January 2012 18:03 To: Discussion of

[Numpy-discussion] Strange error raised by scipy.special.erf

2012-01-22 Thread Nadav Horesh
With N.seterr(all='raise'): from scipy import special import scipy special.erf(26.6) 1.0 scipy.__version__ '0.11.0.dev-81dc505' import numpy as N N.seterr(all='raise') {'over': 'warn', 'divide': 'warn', 'invalid': 'warn', 'under': 'ignore'} special.erf(26.5) 1.0 special.erf(26.6)

Re: [Numpy-discussion] Strange error raised by scipy.special.erf

2012-01-24 Thread Nadav Horesh
@scipy.org Subject: Re: [Numpy-discussion] Strange error raised by scipy.special.erf Le 22/01/2012 11:28, Nadav Horesh a écrit : special.erf(26.5) 1.0 special.erf(26.6) Traceback (most recent call last): File pyshell#7, line 1, in module special.erf(26.6) FloatingPointError: underflow

Re: [Numpy-discussion] histogram help

2012-01-31 Thread Nadav Horesh
Do you want a histogramm of z for each (x,y) ? Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Ruby Stevenson [ruby...@gmail.com] Sent: 30 January 2012 21:27 To: Discussion of Numerical Python Subject:

Re: [Numpy-discussion] Getting C-function pointers from Python to C

2012-04-10 Thread Nadav Horesh
Sorry for being slow. There is (I think) a related question I raised on the skimage list: I have a cython function that calls a C callback function in a loop (one call for each pixel in an image). The C function in compiled in a different shared library (a simple C library, not a python module).

Re: [Numpy-discussion] Getting C-function pointers from Python to C

2012-04-12 Thread Nadav Horesh
Example: lib = ctypes.CDLL('libm.dylib') address_as_integer = ctypes.cast(lib.sin, ctypes.c_void_p).value Excellent! Sorry for the hijack, thanks for rhe ride, Nadav. ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] phase unwrapping (1d)

2013-01-13 Thread Nadav Horesh
There is an unwrap function in numpy. Doesn't it work for you? Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] on behalf of Neal Becker [ndbeck...@gmail.com] Sent: 11 January 2013 17:40 To: numpy-discussion@scipy.org

Re: [Numpy-discussion] Matrix Expontial for differenr t.

2013-01-28 Thread Nadav Horesh
I did not try it, but I assume that you can build a stack of diagonal matrices as a MxNxN array and use tensordot with the matrix v (and it's inverse). The trivial way to accelerate the loop is to calculate in inverse of v before the loop. Nadav

Re: [Numpy-discussion] Generalized inner?

2013-03-24 Thread Nadav Horesh
This is what APL's . operator does, and I found it useful from time to time (but I was much younger then). Nadav Jaime Fernández del Río jaime.f...@gmail.com wrote: The other day I found myself finding trailing edges in binary images doing something like this: arr = np.random.randint(2,

[Numpy-discussion] numpy 1.9b1 bug in pad function?

2014-06-14 Thread Nadav Horesh
In [1]: import numpy as np In [2]: a = np.arange(4) In [3]: np.pad(a,2) --- ValueError    Traceback (most recent call last) ipython-input-3-f56fe53684b8 in module() 1 np.pad(a,2)

Re: [Numpy-discussion] numpy 1.9b1 bug in pad function?

2014-06-14 Thread Nadav Horesh
: [Numpy-discussion] numpy 1.9b1 bug in pad function? Hi Nadav On Sat, Jun 14, 2014 at 8:11 AM, Nadav Horesh nad...@visionsense.com wrote: In [4]: np.__version__ Out[4]: '1.9.0b1' The documentation specify that the mode parameter is optional I don't see the optional specification

Re: [Numpy-discussion] Changing the numpy array into required shape

2014-08-23 Thread Nadav Horesh
Replace data = data.byteswap() By data = data.byteswap()[::-1] Nadav On 23 Aug 2014 09:15, Cleo Drakos cleo21dra...@gmail.com wrote: Hello numpy users: I have 2d numpy array of 480 rows and 1440 columns as named by 'data' below: The first element belongs to (49.875S,179.875W), the

Re: [Numpy-discussion] Meshgrid with Huge Arrays

2010-10-07 Thread Nadav Horesh
You should avoid meshgrid, as the follows: ... #3D ARRAY XArray = np.arange(0, NrHorPixels, 1./sqrt(NrCellsPerPixel)) YArray = np.arange(0, NrVerPixels, 1./sqrt(NrCellsPerPixel)) Z = Amplitude*exp(-(((XArray-GaussianCenterX)**2/(2*SigmaX**2))+((YArray[:,None]-GaussianCenterY)**/(2*SigmaY**2

Re: [Numpy-discussion] [numpy-discussion] Transform 3d data

2010-10-19 Thread Nadav Horesh
You can aid mgrid, riughy as the follows (I may have mistakes, but the direction should be clear): def transform_3d_data_(field,lwrbnd,uprbnd): shape = field.shape XYZ = np.mgrid[lwrbnd[0]:uprbnd[0]:shape[0], lwrbnd[1]:uprbnd[1]:shape[1], lwrbnd[2]:uprbnd[2]:shape[2]] vectors =

Re: [Numpy-discussion] [numpy-discussion] Transform 3d data

2010-10-19 Thread Nadav Horesh
Of course there is an (at least one) error: the line should be: XYZ = np.mgrid[lwrbnd[0]:uprbnd[0]:shape[0]*1j,lwrbnd[1]:uprbnd[1]:shape[1]*1j, lwrbnd[2]:uprbnd[2]:shape[2]*1j] On Tue, 2010-10-19 at 14:10 +0200, Nadav Horesh wrote: You can aid mgrid, riughy as the follows (I may have mistakes

Re: [Numpy-discussion] Precision difference between dot and sum

2010-11-02 Thread Nadav Horesh
... Also, IIRC, 1.0 cannot be represented exactly as a float, Not true Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Matthieu Brucher Sent: Tue 02-Nov-10 11:05 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Precision difference

Re: [Numpy-discussion] How to import input data to make ndarray for batch processing?

2010-11-18 Thread Nadav Horesh
Do you want to save the file to disk as 100x100 matrices, or just to read them into the memory? Are the files in ascii or binary format? Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Venkat

Re: [Numpy-discussion] Error in tanh for large complex argument

2011-01-27 Thread Nadav Horesh
The C code return the right result with glibc 2.12.2 (linux 64 + gcc 4.52). However I get the same nan+nan*j with python. Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Pauli Virtanen [p...@iki.fi]

Re: [Numpy-discussion] Error in tanh for large complex argument

2011-01-28 Thread Nadav Horesh
A brief history: I wrote the asinh and acosh functions for the math (or was it cmath?) for python 2.0. It fixed some problems of GVR implementation, but still it was far from perfect, and replaced shortly after. My 1/4 cent tip: Do not rush --- find a good code. Nadav

[Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
Having numpy, scipy, and matplotlib working reasonably with python3, a major piece of code I miss for a major python3 migration is an image IO. I found that pylab's imread works fine for png image, but I need to read all the other image format as well as png and jpeg output. Any hints

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
, then it should be pretty simple to fix. Zach On Mar 12, 2011, at 4:40 AM, Christoph Gohlke wrote: On 3/12/2011 1:08 AM, Nadav Horesh wrote: Having numpy, scipy, and matplotlib working reasonably with python3, a major piece of code I miss for a major python3 migration is an image IO. I

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
If it doesn't work out of the box on python 3, then it should be pretty simple to fix. Zach On Mar 12, 2011, at 4:40 AM, Christoph Gohlke wrote: On 3/12/2011 1:08 AM, Nadav Horesh wrote: Having numpy, scipy, and matplotlib working reasonably with python3, a major piece of code I miss

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
Gohlke [cgoh...@uci.edu] Sent: 12 March 2011 21:49 To: numpy-discussion@scipy.org Subject: Re: [Numpy-discussion] [OT] any image io module that works with python3? On 3/12/2011 8:45 AM, Nadav Horesh wrote: I forgot to mention that I work on linux (gentoo x86-64).Here are my achievements till

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-12 Thread Nadav Horesh
-boun...@scipy.org] On Behalf Of Christoph Gohlke [cgoh...@uci.edu] Sent: 13 March 2011 00:37 To: numpy-discussion@scipy.org Subject: Re: [Numpy-discussion] [OT] any image io module thatworks withpython3? On 3/12/2011 12:47 PM, Nadav Horesh wrote: After the replacement of ö with o

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-13 Thread Nadav Horesh
Jest tested the installation (after git clone ...). I had to correct the following lines in _build.py to pass installation: lines 72, and 75 should be: f0 = open(f0,'br') f1 = open(f1,'br') Nadav. From: numpy-discussion-boun...@scipy.org

[Numpy-discussion] תשובה: [OT] any image io module that works with python3?

2011-03-14 Thread Nadav Horesh
] בשם Stéfan van der Walt נשלח: Monday, March 14, 2011 00:16 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] [OT] any image io module that works with python3? Hi Nadav On Sun, Mar 13, 2011 at 8:20 PM, Nadav Horesh nad...@visionsense.com wrote: Jest tested the installation (after git

Re: [Numpy-discussion] תשובה: [OT] any image io module that works with python3?

2011-03-14 Thread Nadav Horesh
that works with python3? On Mon, Mar 14, 2011 at 9:55 AM, Nadav Horesh nad...@visionsense.com wrote: The instillation is OK. The problem is that on my wok PC I do not have PIL installed. So: Thanks, you are right of course: no plugin should be required upon import. I now put the use_plugin

Re: [Numpy-discussion] [OT] any image io module that works with python3?

2011-03-15 Thread Nadav Horesh
] On Behalf Of Christoph Gohlke [cgoh...@uci.edu] Sent: 14 March 2011 21:55 To: numpy-discussion@scipy.org Subject: Re: [Numpy-discussion] [OT] anyimage io module that works withpython3? On 3/12/2011 9:56 PM, Nadav Horesh wrote: This lead to another error probably due

[Numpy-discussion] Partial least squares

2011-03-24 Thread Nadav Horesh
I am looking for a partial least sqaures code refactoring for two (X,Y) matrices. I found the following, but they not not work for me: 1. MDP: Factors only one matrix (am I wrong?) 2. pychem: Windows only code (I use Linux) 3. chemometrics from Koders: I get a singularity error. 4. pca_module (By

Re: [Numpy-discussion] Partial least squares

2011-03-24 Thread Nadav Horesh
...@scipy.org] On Behalf Of Gael Varoquaux [gael.varoqu...@normalesup.org] Sent: 24 March 2011 22:04 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Partial least squares On Thu, Mar 24, 2011 at 08:15:12PM +0100, Olivier Grisel wrote: 2011/3/24 Nadav Horesh nad...@visionsense.com

Re: [Numpy-discussion] netcdf to grib format

2011-04-08 Thread Nadav Horesh
Wikipedia has this link http://www.pyngl.ucar.edu/Nio.shtml Does it do the job? Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of dileep kunjaai [dileepkunj...@gmail.com] Sent: 08 April 2011 15:21 To:

Re: [Numpy-discussion] numpy.load truncates read from network file on XP

2011-04-28 Thread Nadav Horesh
Several time I encountered problems in transfering large files between XP stations on a wireless network. Could be a result of the unsafe UDP prtocol used by microsoft network protocol (do not have a vista/7 machines to test it). Nadav From:

[Numpy-discussion] תשובה: faster in1d() for monotonic case?

2011-06-21 Thread Nadav Horesh
Did you try searchsorted? Nadav מאת: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] בשם Michael Katz נשלח: Tuesday, June 21, 2011 10:06 אל: Discussion of Numerical Python נושא: [Numpy-discussion] faster in1d() for monotonic

[Numpy-discussion] Recommndations for an easy GUI

2011-06-27 Thread Nadav Horesh
I have an application which generates and displays RGB images as rate of several frames/seconds (5-15). Currently I use Tkinter+PIL, but I have a problem that it slows down the rate significantly. I am looking for a fast and easy alternative. Platform: Linux I prefer tools that would work also

[Numpy-discussion] תשובה: Recommndations for an easy GUI

2011-06-28 Thread Nadav Horesh
] Recommndations for an easy GUI Have a look at glumpy: http://code.google.com/p/glumpy/ It's quite simple and very fast for images (it's based on OpenGL/shaders). Nicolas On Jun 28, 2011, at 6:38 AM, Nadav Horesh wrote: I have an application which generates and displays RGB images as rate

[Numpy-discussion] Can not compile documentation with python3.2

2011-07-14 Thread Nadav Horesh
I installed numpy-1.6.1-rc3 on python3.2, and used the python3 sphinx port (version 1.1pre) to compile the documentation and got this error: nadav@nadav /dev/shm/numpy-1.6.1rc3/doc $ make latex

Re: [Numpy-discussion] Array vectorization in numpy

2011-07-19 Thread Nadav Horesh
For such expressions you should try numexpr package: It allows the same type of optimisation as Matlab does: run a single loop over the matrix elements instead of repetitive loops and intermediate objects creation. Nadav Besides the matlab/numpy comparison, I think that there is an

Re: [Numpy-discussion] lazy loading ndarrays

2011-07-26 Thread Nadav Horesh
For lazy data loading I use memory-mapped array (numpy.memmap): I use it to process multi-image files that are much larger than the available RAM. Nadav. From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of Craig

Re: [Numpy-discussion] matrix inversion

2011-08-10 Thread Nadav Horesh
The matrix in singular, so you can not expect a stable inverse. Nadav. From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of jp d [yo...@yahoo.com] Sent: 11 August 2011 03:50 To: numpy-discussion@scipy.org Subject:

Re: [Numpy-discussion] SVD does not converge on clean matrix

2011-08-11 Thread Nadav Horesh
Had no problem on a gentoo 64 bit machine using atlas 3.8.0 (Core I7, python 2.7.2, numpy versions1.60 and 1.6.1) Nadav From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org] On Behalf Of dhan...@telecom-paristech.fr

Re: [Numpy-discussion] SVD does not converge on clean matrix

2011-08-12 Thread Nadav Horesh
to be OS or processor dependent. Any ideas? Charanpal Date: Thu, 11 Aug 2011 07:21:09 -0700 From: Nadav Horesh nad...@visionsense.commailto:nad...@visionsense.com Subject: Re: [Numpy-discussion] SVD does not converge on clean matrix To: Discussion of Numerical Python numpy-discussion

[Numpy-discussion] Wrong treatment of byte order?

2011-08-23 Thread Nadav Horesh
My system is a 64 bit gentoo linux on core i7 machine. Numpy version 1.6.1 and pyton(s) 2.7.2 and 3.2.1 Problem summary: I tried t invert a matrix of explicit little endian byte-order and got an error. The inversion run properly with a native byte order, and I get a wrong answer with not

[Numpy-discussion] Wrong treatment of byte-order.

2011-08-30 Thread Nadav Horesh
Hi, This is my second post on this problem I found in numpy 1.6.1, and recently it cam up in the latest git version (2.0.0.dev-f3e70d9). The problem is numpy treats the native byte order ('') as illegal while the wrong one ('') as the right one. The output of the attached script (bult for

Re: [Numpy-discussion] Example Usage of Neighborhood Iterator in Cython

2011-10-18 Thread Nadav Horesh
Just in time! I was just working on a cythonic replacement to ndimage.generic_filter (well, I took a a short two years break in the middle). thank you very much, Nadav. From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org]

[Numpy-discussion] array iterators and cython prange

2011-10-23 Thread Nadav Horesh
of iterators. Is there an *easy* way to work with nmpy iterators while the GIL is released? Platfoem: numpy 1.6.1 on python 2.7.2 and cython 0.15.1 system: gcc on linux Nadav# A Cython + Neighbourhood based biliteral filter # Nadav Horesh

[Numpy-discussion] neighborhood iterator speed

2011-10-23 Thread Nadav Horesh
I am trying to replace an old code (biliteral filter) that rely on ndimage.generic_filter with the neighborhood iterator. In the old code, the generic_filter generates a contiguous copy of the neighborhood, thus the (cython) code could use C loop to iterate over the neighbourhood copy. In the

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
, 2011 at 6:57 AM, Nadav Horesh nad...@visionsense.com wrote: I am trying to replace an old code (biliteral filter) that rely on ndimage.generic_filter with the neighborhood iterator. In the old code, the generic_filter generates a contiguous copy of the neighborhood, thus the (cython) code

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
...@scipy.org] On Behalf Of David Cournapeau Sent: Monday, October 24, 2011 1:57 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24, 2011 at 10:48 AM, Nadav Horesh nad...@visionsense.com wrote: * Iterator mode: Mirror. Does the mode make a huge

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
[mailto:numpy-discussion-boun...@scipy.org] On Behalf Of David Cournapeau Sent: Monday, October 24, 2011 4:04 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24, 2011 at 1:23 PM, Nadav Horesh nad...@visionsense.com wrote: * I'll try

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-24 Thread Nadav Horesh
of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed On Mon, Oct 24, 2011 at 1:23 PM, Nadav Horesh nad...@visionsense.com wrote: * I'll try to implement the 2D iterator as far as far as my programming expertise goes. It might take few days. I am pretty sure the code

Re: [Numpy-discussion] neighborhood iterator speed

2011-10-25 Thread Nadav Horesh
: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Nadav Horesh Sent: Monday, October 24, 2011 9:02 PM To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator speed I found the 2d iterator definition active in numpy 1.6.1. I'll

Re: [Numpy-discussion] Large numbers into float128

2011-10-30 Thread Nadav Horesh
A quick and dirty cython code is attached Use: import Float128 a = Float128.Float128('1E500') array([ 1e+500], dtype=float128) or b = np.float128(1.34) * np.float128(10)**2500 b 1.3400779e+2500 Maybe there is also a way to do it in a pure python code via ctypes? Nadav

[Numpy-discussion] optimize.fmin_cg bug

2006-12-28 Thread Nadav Horesh
optimize.fmin_cg fails when the function to be minimized returns a numpy scalar: from numpy import * from scipy import optimize f = lambda x: exp(x)-x df = lambda x: exp(x)-1.0 scipy.optimize.fmin(f, [0.2]) Traceback (most recent call last): File pyshell#4, line 1, in module

Re: [Numpy-discussion] Numpy and iterative procedures

2007-02-16 Thread Nadav Horesh
At first glance it doesn't look hard to, at least, avoid looping over i, by replacing [i] by [:-2], [i+1] by [1:-1] and [i+2] by [2:]. But I might be wrong. Can you submit the piece of code with at least the most internal loop? Nadav. -Original Message- From: [EMAIL PROTECTED] on

Re: [Numpy-discussion] (no subject)

2007-02-16 Thread Nadav Horesh
])**2 v[N-1]=temp[N-1] return v -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nadav Horesh Sent: Friday, February 16, 2007 8:52 AM To: Discussion of Numerical Python Subject: RE: [Numpy-discussion] Numpy and iterative procedures At first

Re: [Numpy-discussion] problem reading binary data from file

2007-04-07 Thread Nadav Horesh
How about: numpy.fromfile(filename, dtype='i2') Nadav -Original Message- From: [EMAIL PROTECTED] on behalf of Pierre GM Sent: Fri 06-Apr-07 18:41 To: Discussion of Numerical Python Cc: Subject:Re: [Numpy-discussion] problem reading binary data from file On Friday

Re: [Numpy-discussion] Do we still need support for Python 2.3?

2007-05-21 Thread Nadav Horesh
The question should be: Are there members who rely on python 2.3 Nadav -Original Message- From: [EMAIL PROTECTED] on behalf of Pearu Peterson Sent: Mon 21-May-07 16:35 To: Discussion of Numerical Python Cc: Subject:[Numpy-discussion] Do we still need support for

Re: [Numpy-discussion] Python equivalent of bwboundaries, bwlabel

2007-06-29 Thread Nadav Horesh
There are several image processing function (including labeling) in numpy.numarray.nd_image package. You can find nd_image documentation in numarray-1.5.pdf (http://downloads.sourceforge.net/numpy/numarray-1.5.pdf?modtime=1133880381big_mirror=0) Nadav. -Original Message- From:

Re: [Numpy-discussion] deleting value from array

2007-08-16 Thread Nadav Horesh
The closest I can think of is: a = a[range(len(a)) != 1] Nadav. On Wed, 2007-08-15 at 02:07 -0700, mark wrote: I am trying to delete a value from an array This seems to work as follows a = array([1,2,3,4]) a = delete( a, 1 ) a array([1, 3, 4]) But wouldn't it make more sense

Re: [Numpy-discussion] how to convert btw rgb and pixel value

2007-11-05 Thread Nadav Horesh
If the image is in the form of a standard image format (png, bmp, jpeg...) you can use the PIL library. png file can be read by pylab's imread function. Nadav. On Sun, 2007-11-04 at 23:37 -0800, [EMAIL PROTECTED] wrote: hi i wish to convert an rgb image into an array of double values..is

Re: [Numpy-discussion] OT: A Way to Approximate and Compress a 3DSurface

2007-11-21 Thread Nadav Horesh
Wouldn't a random or regular subsampling of the set will do the job? For data interpolation: 2D-Delaunay triangulation based method (I think you can find one in the scipy cookbook). Nadav. -Original Message- From: [EMAIL PROTECTED] on behalf of Geoffrey Zhu Sent: Tue 20-Nov-07 19:50

Re: [Numpy-discussion] data transit

2007-12-08 Thread Nadav Horesh
Did you look at pytables (http://www.pytables.org/moin)? Nadav. -Original Message- From: [EMAIL PROTECTED] on behalf of Renato Serodio Sent: Fri 07-Dec-07 17:44 To: Discussion of Numerical Python Subject: [Numpy-discussion] data transit Hello all, I'm developing a custom

[Numpy-discussion] Can not update a submatrix

2008-01-30 Thread Nadav Horesh
In the following piece of code: import numpy as N R = N.arange(9).reshape(3,3) ax = [1,2] R array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) R[ax,:][:,ax] = 100 R array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) Why R is not updated? I was expecting: R array([[0, 1, 2],

Re: [Numpy-discussion] Can not update a submatrix

2008-01-30 Thread Nadav Horesh
, Francesc Altet wrote: A Wednesday 30 January 2008, Nadav Horesh escrigué: In the following piece of code: import numpy as N R = N.arange(9).reshape(3,3) ax = [1,2] R array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) R[ax,:][:,ax] = 100 R array([[0, 1, 2

Re: [Numpy-discussion] Can not update a submatrix

2008-01-30 Thread Nadav Horesh
. On 1/30/08, Francesc Altet [EMAIL PROTECTED] wrote: A Wednesday 30 January 2008, Nadav Horesh escrigué: In the following piece of code: import numpy as N R = N.arange(9).reshape(3,3) ax = [1,2] R array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) R

Re: [Numpy-discussion] Can not update a submatrix

2008-01-31 Thread Nadav Horesh
/2008, Francesc Altet [EMAIL PROTECTED] wrote: A Wednesday 30 January 2008, Nadav Horesh escrigué: In the following piece of code: import numpy as N R = N.arange(9).reshape(3,3) ax = [1,2] R array([[0, 1, 2

Re: [Numpy-discussion] searchsorted bug

2008-01-31 Thread Nadav Horesh
It works fine also for me (numpy 1.04 gentoo linux on amd64) Nadav On Thu, 2008-01-31 at 15:51 +0100, lorenzo bolla wrote: works fine for me. In [33]: A = numpy.array(['a','aa','b']) In [34]: B = numpy.array(['d','e']) In [35]: A.searchsorted(B) Out[35]: array([3, 3]) In [36]:

Re: [Numpy-discussion] partial_sum/adj_difference?

2008-02-19 Thread Nadav Horesh
-Original Message- From: [EMAIL PROTECTED] on behalf of Francesc Altet Instead of for i in range(len(a)): ps[i] = a[:i].sum() use a.cumsum() Nadav Sent: Tue 19-Feb-08 20:59 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] partial_sum/adj_difference? A

[Numpy-discussion] distutils, fcompiler and Mayavi

2009-11-08 Thread Nadav Horesh
Hi all, Recentrly I tried to install mayavi-3,3,0, and it failed with a long chain of error messages ended with . . . File /usr/lib64/python2.6/site-packages/numpy/distutils/command/config_compiler.py, line 66, in finalize_options v = getattr(c,a) File

[Numpy-discussion] numpy distutils and fcompiler error again

2009-11-14 Thread Nadav Horesh
I encountered again the error AttributeError: fcompiler this time when tried to install scikits.image-0.2.2. The full log from python setup.py instal is: Warning: Assuming default configuration (scikits/{setup_scikits,setup}.py was not found) Appending scikits configuration to Ignoring

[Numpy-discussion] neighborhood iterator

2009-11-22 Thread Nadav Horesh
I wonder if the neighbourhood iterator can be used as a more efficient replacement for ndimage.generic_filter. Is there a way to use it from cython? Nadav. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] neighborhood iterator

2009-11-23 Thread Nadav Horesh
-Nov-09 03:21 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] neighborhood iterator On 22-Nov-09, at 12:50 PM, Nadav Horesh wrote: I wonder if the neighbourhood iterator can be used as a more efficient replacement for ndimage.generic_filter. Is there a way to use

Re: [Numpy-discussion] boolean arrays

2009-11-26 Thread Nadav Horesh
It is obvious to me that True+False == True,. Why do you think it should be False? Nadav On Thu, 2009-11-26 at 14:20 +0100, Nils Wagner wrote: Hi all, is the following behaviour correct a = array(([True,True],[True,True])) b = array(([False,False],[False,False])) a+b array([[

Re: [Numpy-discussion] Numpy 1.4.0 rc1 released

2009-12-02 Thread Nadav Horesh
I got the following errors with a clean installation of numpy (previous installations deleted): Running unit tests for numpy NumPy version 1.4.0rc1 NumPy is installed in /usr/lib64/python2.6/site-packages/numpy Python version 2.6.4 (r264:75706, Nov 5 2009, 20:27:15) [GCC 4.3.4] nose version

[Numpy-discussion] Test of numpy/py3k

2009-12-07 Thread Nadav Horesh
I would like to test and prepare for migration of numpy/python3.1 on a linux box. Can anyone provide an installation recipe (and maybe some more tips)? Nadav. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Test of numpy/py3k

2009-12-07 Thread Nadav Horesh
Thanks, it works. Nadav On Mon, 2009-12-07 at 11:33 +0200, Pauli Virtanen wrote: Hi, ma, 2009-12-07 kello 10:36 +0200, Nadav Horesh kirjoitti: I would like to test and prepare for migration of numpy/python3.1 on a linux box. Can anyone provide an installation recipe (and maybe some

[Numpy-discussion] small doc error in numpy.random.randn

2009-12-15 Thread Nadav Horesh
The 2nd line of the doc string randn([d1, ..., dn]) should be randn(d1, ..., dn) Nadav ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Matlab's griddata3 for numpy?

2009-12-23 Thread Nadav Horesh
You probably have to use the generic interpolation function from scipy.interpolate module: scipy.interpolate.splprep, scipy.interpolate.splev, etc. It could be cumbersome but doable. Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of reckoner Sent: Wed

Re: [Numpy-discussion] extracting data from ODF files

2010-01-05 Thread Nadav Horesh
There is a possibility to export the data to excel format and use xlrd or similar package to read it. Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Manuel Wittchen Sent: Tue 05-Jan-10 23:14 To: Discussion of Numerical Python Subject:

Re: [Numpy-discussion] Request for testing

2010-02-21 Thread Nadav Horesh
$ python isinf.py Warning: invalid value encountered in isinf True machine: gentoo linux on amd64 python 2.6.4 (64 bit) gcc 4.3.4 numpy.__version__ == '1.4.0' glibc 2.10.1 Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Charles R Harris Sent: Sun

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-03 Thread Nadav Horesh
There is a work by Sturla Molden: look for multiprocessing-tutorial.pdf and sharedmem-feb13-2009.zip. The tutorial includes what is dropped in the cookbook page. I am into the same issue and going to test it today. Nadav On Wed, 2010-03-03 at 15:31 +0100, Jesper Larsen wrote: Hi people, I

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Nadav Horesh
Maybe the attached file can help. Adpted and tested on amd64 linux Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Nadav Horesh Sent: Thu 04-Mar-10 10:54 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] multiprocessing shared arrays

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Nadav Horesh
...@scipy.org on behalf of Nadav Horesh Sent: Thu 04-Mar-10 11:55 To: Discussion of Numerical Python Subject: RE: [Numpy-discussion] multiprocessing shared arrays and numpy Maybe the attached file can help. Adpted and tested on amd64 linux Nadav -Original Message- From: numpy-discussion-boun

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-04 Thread Nadav Horesh
: [Numpy-discussion] multiprocessing shared arrays and numpy What kind of calculations are you doing with this module? Can you please send some examples and the speed-ups you are getting? Thanks, Francesc A Thursday 04 March 2010 14:06:34 Nadav Horesh escrigué: Extended module that I used

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-06 Thread Nadav Horesh
codes. +1 Thanks for emphasizing this. This is definitely a big issue with multicore. Cheers, Brian Thanks for sharing your experience anyway, Francesc A Thursday 04 March 2010 18:54:09 Nadav Horesh escrigué: I can not give a reliable answer yet, since I have some more improvement

Re: [Numpy-discussion] multiprocessing shared arrays and numpy

2010-03-11 Thread Nadav Horesh
Here is a strange thing I am getting with multiprocessing and memory mapped array: The below script generates the error message 30 times (for every slice access): Exception AttributeError: AttributeError('NoneType' object has no attribute 'tell',) in bound method memmap.__del__ of

Re: [Numpy-discussion] StringIO test failure with Python3.1.2

2010-03-24 Thread Nadav Horesh
Any idea why from .io import StringIO and not from io import StringIO ??? (Why is the extra . before io) Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Bruce Southey Sent: Wed 24-Mar-10 16:17 To: Discussion of Numerical Python Subject:

Re: [Numpy-discussion] Applying formula to all in an array which hasvalue from previous

2010-03-29 Thread Nadav Horesh
The general guideline: Suppose the function definition is: def func(x,y): # x and y are scalars bla bla bla ... return z # a scalar So, import numpy as np vecfun = np.vectorize(func) vecfun.ufunc.accumulate(array((0,1,2,3,4,5,6,7,8,9)) Nadav. -Original Message-

Re: [Numpy-discussion] Is this odd?

2010-04-02 Thread Nadav Horesh
In python empty sequences are always equivalent to False, and non-empty to True. You can use this property or: if len(b) 0: . Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Shailendra Sent: Fri 02-Apr-10 06:07 To: numpy-discussion@scipy.org

[Numpy-discussion] Annoyance of memap rray with multiprocessing.Pool.applay_async

2010-04-03 Thread Nadav Horesh
The following script generate the following error on every loop iteration in the function average: Exception AttributeError: AttributeError('NoneType' object has no attribute 'tell',) in bound method memmap.__del__ of memmap(xx) ignored where xx is a scalar (the array sum). I get

Re: [Numpy-discussion] Annoyance of memap rray withmultiprocessing.Pool.applay_async

2010-04-03 Thread Nadav Horesh
-discussion] Annoyance of memap rray withmultiprocessing.Pool.applay_async On Sat, Apr 3, 2010 at 14:29, Nadav Horesh nad...@visionsense.com wrote: The following script generate the following error on every loop iteration in the function average: Exception AttributeError: AttributeError('NoneType

Re: [Numpy-discussion] Annoyance of memap rraywithmultiprocessing.Pool.applay_async

2010-04-05 Thread Nadav Horesh
rraywithmultiprocessing.Pool.applay_async On Sat, Apr 3, 2010 at 22:35, Nadav Horesh nad...@visionsense.com wrote: Got it, thank you. But why, nevertheless, the results are correct although the pickling is impossible? Rather, I meant that they don't pickle correctly. They use ndarray's pickling, which will copy

[Numpy-discussion] Name of the file associated with a memmap

2010-04-12 Thread Nadav Horesh
Is there a way to get the file-name given a memmap array object? Nadav ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] rc2 for NumPy 1.4.1 and Scipy 0.7.2

2010-04-12 Thread Nadav Horesh
Tried of install numy-1.4.1-rc2 on python-2.7b1 and got an error: (64 bit linux on core2, gcc4.4.3) compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include

Re: [Numpy-discussion] look for value, depending to y position

2010-04-14 Thread Nadav Horesh
I assume that you forgot to specify the range between 300 and 400. But anyway this piece of code may give you a direction: -- import numpy as np ythreshold = np.repeat(np.arange(4,-1,-1), 100) * 20 +190 bin_image = image ythreshold[:,None]

Re: [Numpy-discussion] Need faster equivalent to digitize

2010-04-15 Thread Nadav Horesh
import numpy as N N.repeat(N.arange(len(a)), a) Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Peter Shinners Sent: Thu 15-Apr-10 08:30 To: Discussion of Numerical Python Subject: [Numpy-discussion] Need faster equivalent to digitize I am using

[Numpy-discussion] savetxt not working with python3.1

2010-05-13 Thread Nadav Horesh
in module npyio.py lines 794,796 file should be replaced by _file Nadav ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Saving an array on disk to free memory - Pickling

2010-05-17 Thread Nadav Horesh
Is a memory mapped file is a viable solution to your problem? Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Jean-Baptiste Rudant Sent: Mon 17-May-10 14:03 To: Numpy Discussion Subject: [Numpy-discussion] Saving an array on disk to free memory -

Re: [Numpy-discussion] calling C function from Python via f2py

2010-05-23 Thread Nadav Horesh
in test.py change to print FFMCcalc.FFMCcalc(T,H,W,ro,Fo) As implied from the line print FFMCcalc.FFMCcalc.__doc__ Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Matt Fearon Sent: Fri 21-May-10 21:55 To: numpy-discussion@scipy.org Subject:

  1   2   3   >