Re: [Numpy-discussion] Multi-distribution Linux wheels - please test

2016-02-09 Thread Nadav Horesh
ant to the main topic of the thread, but FYI I think the > recarray issues are fixed in 1.10.4.) > > On Feb 7, 2016 11:10 PM, "Nadav Horesh" <nad...@visionsense.com> wrote: >> >> I have atlas-lapack-base installed via pacman (required by sagemath). >> Since

Re: [Numpy-discussion] Multi-distribution Linux wheels - please test

2016-02-07 Thread Nadav Horesh
The reult tests of numpy 1.10.4 installed from source: OK (KNOWNFAIL=4, SKIP=6) I think I use openblas, as it is installed instead the normal blas/cblas. Nadav, From: NumPy-Discussion <numpy-discussion-boun...@scipy.org> on behalf of Nadav

Re: [Numpy-discussion] Multi-distribution Linux wheels - please test

2016-02-07 Thread Nadav Horesh
n Sun, Feb 7, 2016 at 10:09 PM, Nadav Horesh <nad...@visionsense.com> wrote: > Thank you fo reminding me, it is OK now: > $ python -c 'import numpy; print(numpy.__config__.show())' > > lapack_opt_info: > library_dirs = ['/usr/local/lib'] > language = c > libra

Re: [Numpy-discussion] Multi-distribution Linux wheels - please test

2016-02-07 Thread Nadav Horesh
org> on behalf of Matthew Brett <matthew.br...@gmail.com> Sent: 08 February 2016 01:33 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] Multi-distribution Linux wheels - please test Hi, On Sun, Feb 7, 2016 at 2:06 AM, Nadav Horesh <nad...@visionsense.com> wrote:

Re: [Numpy-discussion] Multi-distribution Linux wheels - please test

2016-02-06 Thread Nadav Horesh
Test platform: python 3.4.1 on archlinux x86_64 scipy test: OK OK (KNOWNFAIL=97, SKIP=1626) numpy tests: Failed on long double and int128 tests, and got one error: Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/nose/case.py", line 198, in runTest

Re: [Numpy-discussion] [OT] Interpolation of an unevently sampled bandwidth limited signal

2016-02-04 Thread Nadav Horesh
oun...@scipy.org> on behalf of Evgeni Burovski <evgeny.burovs...@gmail.com> Sent: 04 February 2016 11:42 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] [OT] Interpolation of an unevently sampled bandwidth limited signal On Thu, Feb 4, 2016 at 9:32 AM, Nadav

[Numpy-discussion] [OT] Interpolation of an unevently sampled bandwidth limited signal

2016-02-04 Thread Nadav Horesh
I have several cases of hand digitized spectra that I'd like to resample these spectra at even spacings. My problem is that cubic or RBF splines often result in an unacceptible over-shooting. Is there a python module that provides something similar to sinc interpolation on unevenly space

Re: [Numpy-discussion] [OT] Interpolation of an unevently sampled bandwidth limited signal

2016-02-04 Thread Nadav Horesh
Harris <charlesr.har...@gmail.com> Sent: 04 February 2016 17:17 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] [OT] Interpolation of an unevently sampled bandwidth limited signal On Thu, Feb 4, 2016 at 4:34 AM, Nadav Horesh <nad...@visionsense.com<mailto:nad.

Re: [Numpy-discussion] Numpy 1.11.0b1 is out

2016-01-27 Thread Nadav Horesh
Why the dot function/method is slower than @ on python 3.5.1? Tested from the latest 1.11 maintenance branch. np.__version__ Out[39]: '1.11.0.dev0+Unknown' %timeit A @ c 1 loops, best of 3: 185 µs per loop %timeit A.dot(c) 1000 loops, best of 3: 526 µs per loop %timeit np.dot(A,c)

Re: [Numpy-discussion] Numpy 1.10.2rc2 released

2015-12-09 Thread Nadav Horesh
Is is possible that recarray are slow again? Nadav From: NumPy-Discussion on behalf of Charles R Harris Sent: 08 December 2015 03:41 To: numpy-discussion; SciPy Developers List; SciPy Users

[Numpy-discussion] dot product: large speed difference metween seemingly indentical operations

2015-10-17 Thread Nadav Horesh
The functions dot, matmul and tensordot performs the same on a MxN matrix multiplied by length N vector, but very different if the matrix is replaced by a PxQxN array. Why? In [3]: a = rand(100,3) In [4]: a1 = a.reshape(1000,1000,3) In [5]: w = rand(3) In [6]: %timeit a.dot(w) 100

Re: [Numpy-discussion] A regression in numpy 1.10: VERY slow memory mapped file generation

2015-10-14 Thread Nadav Horesh
Subject: Re: [Numpy-discussion] A regression in numpy 1.10: VERY slow memory mapped file generation On 10/14/2015 01:23 AM, Nadav Horesh wrote: > > I have binary files of size range between few MB to 1GB, which I read process > as memory mapped files (via np.memmap). Until numpy 1.9 the cre

[Numpy-discussion] A regression in numpy 1.10: VERY slow memory mapped file generation

2015-10-13 Thread Nadav Horesh
I have binary files of size range between few MB to 1GB, which I read process as memory mapped files (via np.memmap). Until numpy 1.9 the creation  of recarray on an existing file (without reading its content) was instantaneous, and now it takes ~6 seconds (system: archlinux on sandy bridge).

Re: [Numpy-discussion] np.diag(np.dot(A, B))

2015-05-22 Thread Nadav Horesh
There was an idea on this list to provide a function the run multiple dot on several vectors/matrices. It seems to be a particular implementation of this proposed function. Nadav. On 22 May 2015 11:58, David Cournapeau courn...@gmail.com wrote: On Fri, May 22, 2015 at 5:39 PM, Mathieu

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

[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] 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,

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] 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] 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] 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] 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] 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

[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] 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

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] 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

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] 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

[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] 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] 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

[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

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

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] 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] 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] 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

[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

[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] 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] תשובה: 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

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:

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:

[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] [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] תשובה: [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-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-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] 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

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] 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] 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] [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] 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] Viewer for 2D Numpy arrays (GUI)

2010-09-17 Thread Nadav Horesh
View 2D arrays: Most convenient: Matplotlib (imshow) As surface plot: Mayavi (Matplotlib has surface plots, but it is slow for large arrays) Modify files: I think the IDE spyder could help (and you can use mayavi/matplotlib within) Nadav -הודעה מקורית- מאת:

[Numpy-discussion] A bug in boolean indexing?

2010-07-29 Thread Nadav Horesh
The following does not raise an error: a = np.arange(5) a[a0] = a although a.shape == (5,) while a[a0].shape == (4,) I get in on python2.6.5, numpy 1.4.1 on win32, and python 2.6.5, numpy 2.0.0.dev8469 on linux64. Nadav. ___ NumPy-Discussion

Re: [Numpy-discussion] A bug in boolean indexing?

2010-07-29 Thread Nadav Horesh
: Re: [Numpy-discussion] A bug in boolean indexing? On 7/29/2010 4:04 AM, Nadav Horesh wrote: a = np.arange(5) a[a0] = a This has nothing to do with reusing ``a``:: b = np.arange(50) a[a0] = b a array([0, 0, 1, 2, 3]) Note however that reusing

Re: [Numpy-discussion] numpy 1.5 or 2.0

2010-07-19 Thread Nadav Horesh
Till now I see that numpy2 plays well with PIL, Matplotlib, scipy and maybe some other packages. Should I expect that it might break? Nadav. -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Pauli Virtanen Sent: Mon 19-Jul-10 10:54 To: Discussion of Numerical

[Numpy-discussion] numpy 1.5 or 2.0

2010-07-18 Thread Nadav Horesh
What is the difference between these two versions? I usually check out the svn version (now 2.0) and it compiles well with python 2.6, 2.7 and 3.1. Nadav. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Nadav Horesh
int can be larger than numpy.int64 therefore it should be coerced to float64 (or float96/float128) Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Pearu Peterson Sent: Sun 13-Jun-10 12:08 To: Discussion of Numerical Python Subject: [Numpy-discussion]

Re: [Numpy-discussion] Reading 12bits numbers ?

2010-06-08 Thread Nadav Horesh
You can. If each number occupies 2 bytes (16 bits) it is straight forward. If it is a continues 12 bits stream you have to unpack by your self: data = np.fromstring(str12bits, dtype=np.uint8) data1 = data.astype(no.uint16) data1[::3] = data1[::3]*256 + data1[1::3] // 16 data1[1::3] = (data[1::3]

Re: [Numpy-discussion] Can not compile numpy with python2.7 onllinux

2010-05-24 Thread Nadav Horesh
] Can not compile numpy with python2.7 onllinux On Sun, May 23, 2010 at 1:40 AM, Nadav Horesh nad...@visionsense.comwrote: I think that line 3405 in _capi.c (svn 8386) should be: #if PY_VERSION_HEX = 0x0301 (At least it looks reasonable considering line 3375, and it solves my problem

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

2010-05-24 Thread Nadav Horesh
is not executing? Syntax to the call the C function from Python is the following: FFMCcalc.FFMCcalc(T,H,W,ro,Fo) Should this execute the C code? thanks, Matt On Sun, May 23, 2010 at 1:44 AM, Nadav Horesh nad...@visionsense.com wrote: in test.py change to print FFMCcalc.FFMCcalc(T,H,W,ro,Fo) As implied

Re: [Numpy-discussion] loadtxt raises an exception on empty file

2010-05-24 Thread Nadav Horesh
You can just catch the exception and decide what to do with it: try: data = np.loadtxt('foo.txt') except IOError: data = 0 # Or something similar Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Maria Liukis Sent: Tue 25-May-10 01:14 To:

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:

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 -

[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] 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

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]

[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] 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] 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] 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

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] 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] 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] 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-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-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] 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] 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] 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

[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

  1   2   3   >