Re: [Numpy-discussion] Unhandled floating point exception running test in numpy-1.0.3 and svn 3875

2007-06-23 Thread Stefan van der Walt
Hi John On Sat, Jun 23, 2007 at 07:35:35PM +, John Ollinger wrote: > > I have just been updating our version of Python, numpy and scipy and have run > into a floating point exception that crashes Python when I test the release. > > I am running gcc 3.3.1 on SuSe Linux 2.4.21-144-smp4G. Th

Re: [Numpy-discussion] Help installing numpy 1.0.2 on LINUX

2007-06-24 Thread Stefan van der Walt
On Sun, Jun 24, 2007 at 05:58:33PM +0100, John Pruce wrote: > When I try to run numpy.test(level=1) I get: > > >>> import numpy > >>> numpy.test(level=1) > Traceback (most recent call last) >File "". line 1, in > AttributeError: 'module' has no attribute 'test' > >>> > > Thank you for your

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-14 Thread Stefan van der Walt
On Mon, Jul 09, 2007 at 12:32:02PM -0700, Timothy Hochberg wrote: > I gave this a try. Since so much code is auto-generated, it can be difficult > to > figure out what's going on in the core matrix stuff. Still, it seems like the > solution is almost absurdly easy, consisting of changing only thre

[Numpy-discussion] Finalising documentation guidelines for NumPy

2007-07-17 Thread Stefan van der Walt
Hi all, In May this year, Charles Harris posted to this mailing list http://thread.gmane.org/gmane.comp.python.numeric.general/15381/focus=15407 discussing some shortcomings of the current NumPy (and hence SciPy) documentation standard http://projects.scipy.org/scipy/numpy/browser/trunk/numpy/d

Re: [Numpy-discussion] Finalising documentation guidelines for NumPy

2007-07-17 Thread Stefan van der Walt
On Tue, Jul 17, 2007 at 01:58:24PM -0400, Alan G Isaac wrote: > On Tue, 17 Jul 2007, Stefan van der Walt apparently wrote: > >var1 : > >Description. > >breaks. This can be fixed either by omitting the colon after > >'var1' in the second ca

Re: [Numpy-discussion] getting numPy happening for sciPy

2007-07-23 Thread Stefan van der Walt
Hi Tim On Mon, Jul 23, 2007 at 08:20:24PM +0930, Tim Mortimer wrote: > I am not an experienced programmer, so the idea of building NumPy from > the "bleeding edge" repository is beyond my capability, as there appears > to be no specific instructions for how to do this (that don't assume you > h

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Stefan van der Walt
On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: > On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: > > The codeGenerator is magic, if you ask me: > > http://starship.python.net/crew/theller/ctypes/old/codegen.html > > Can it wrap code passing around arrays ? If so it

Re: [Numpy-discussion] build on windows 64-bit platform

2007-07-27 Thread Stefan van der Walt
On Fri, Jul 27, 2007 at 04:54:45PM +0200, Pearu Peterson wrote: > > > Stefan van der Walt wrote: > > Hi all, > > > > The build is still failing on winXP 64-bit, as shown on the buildbot > > page > > > > http://buildbot.scipy.org/Windows%20XP%20x86_6

[Numpy-discussion] build on windows 64-bit platform

2007-07-27 Thread Stefan van der Walt
Hi all, The build is still failing on winXP 64-bit, as shown on the buildbot page http://buildbot.scipy.org/Windows%20XP%20x86_64%20MSVC/builds/25/step-shell/0 with the error AttributeError: MSVCCompiler instance has no attribute '_MSVCCompiler__root' Could someone familiar with the MSVC compi

Re: [Numpy-discussion] build on windows 64-bit platform

2007-07-27 Thread Stefan van der Walt
On Sat, Jul 28, 2007 at 12:54:52AM +0200, Pearu Peterson wrote: > Ok, I have now enabled DISTUTILS_USE_SDK for > AMD64 Windows platform and it seems working.. Fantastic, thanks! > However, the build still fails but now the > reason seems to be related to numpy ticket 164: > >http://projects.

Re: [Numpy-discussion] reading 10 bit raw data into an array

2007-07-30 Thread Stefan van der Walt
On Mon, Jul 30, 2007 at 04:01:46PM +0200, Danny Chan wrote: > I'm trying to read a data file that contains a raw image file. Every pixel is > assigned a value from 0 to 1023, and all pixels are stored from top left to > bottom right pixel in binary format in this file. I know the width and the > he

Re: [Numpy-discussion] numpy arrays, data allocation and SIMD alignement

2007-08-08 Thread Stefan van der Walt
On Tue, Aug 07, 2007 at 01:33:24AM -0400, Anne Archibald wrote: > Well, it can be done in Python: just allocate a too-big ndarray and > take a slice that's the right shape and has the right alignment. But > this sucks. Could you explain to me why is this such a bad idea? Stéfan __

Re: [Numpy-discussion] vectorized function inside a class

2007-08-08 Thread Stefan van der Walt
Hi Mark On Wed, Aug 08, 2007 at 03:37:09PM -, mark wrote: > I am trying to figure out a way to define a vectorized function inside > a class. > This is what I tried: > > class test: > def __init__(self): > self.x = 3.0 > def func(self,y): > rv = self.x

Re: [Numpy-discussion] vectorized function inside a class

2007-08-08 Thread Stefan van der Walt
On Wed, Aug 08, 2007 at 08:54:18AM -0700, Timothy Hochberg wrote: > Don't use vectorize? Something like: > > def f(self,y): > return np.where(y > self.x, y, self.x) A one-liner, cool. Benchmarks on some other methods: Method 1: N.where 100 loops, best of 3: 9.32 ms per loop Method 2: N.cl

Re: [Numpy-discussion] numpy arrays, data allocation and SIMD alignement

2007-08-09 Thread Stefan van der Walt
On Thu, Aug 09, 2007 at 04:52:38PM +0900, David Cournapeau wrote: > Charles R Harris wrote: > > > > Well, what you want might be very easy to do in python, we just need > > to check the default alignments for doubles and floats for some of the > > other compilers, architectures, and OS's out ther

Re: [Numpy-discussion] Finding a row match within a numpy array

2007-08-18 Thread Stefan van der Walt
On Tue, Aug 14, 2007 at 11:53:03AM +0100, Andy Cheesman wrote: > Dear nice people > > I'm trying to match a row (b) within a large numpy array (a). My most > successful attempt is below > > hit = equal(b, a) > total_hits = add.reduce(hit, 1) > max_hit = argmax(total_hits, 0) > answer = a[max_hit]

Re: [Numpy-discussion] Finding a row match within a numpy array

2007-08-18 Thread Stefan van der Walt
On Tue, Aug 14, 2007 at 11:53:03AM +0100, Andy Cheesman wrote: > Dear nice people > > I'm trying to match a row (b) within a large numpy array (a). My most > successful attempt is below > > hit = equal(b, a) > total_hits = add.reduce(hit, 1) > max_hit = argmax(total_hits, 0) > answer = a[max_hit]

Re: [Numpy-discussion] fast putmask implementation

2007-08-20 Thread Stefan van der Walt
On Sat, Aug 18, 2007 at 01:51:50AM -0600, Travis Oliphant wrote: > > Not any more! See the revised PEP 007, > > http://www.python.org/dev/peps/pep-0007/ > > > > In Python 3000 (and in the 2.x series, in new source files), > > we'll switch to a different indentation style: 4 spaces per i

Re: [Numpy-discussion] Error in allclose with inf values

2007-08-20 Thread Stefan van der Walt
Hi Matthew On Fri, Aug 17, 2007 at 01:11:41PM +0100, Matthew Brett wrote: > I noticed that allclose does not always behave correctly for arrays with infs. > > I've attached a test script for allclose, and here's an alternative > implementation that I believe behaves correctly. Thanks for the pat

Re: [Numpy-discussion] Setting numpy record array elements

2007-08-20 Thread Stefan van der Walt
On Mon, Aug 20, 2007 at 08:34:53AM -0500, Sameer DCosta wrote: > In the example below I have a record array *a* that has a column > *col1". I am trying to set the first element of a.col1 to zero in two > different ways. > > 1. a[0].col1 = 0 (This fails silently) > 2. a.col1[0] = 0 (This works fin

Re: [Numpy-discussion] Setting numpy record array elements

2007-08-20 Thread Stefan van der Walt
Hi Sameer On Mon, Aug 20, 2007 at 06:26:30PM -0500, Sameer DCosta wrote: > On 8/20/07, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > Thanks Stefan for offering to take a closer look. I have attached a > patch against the latest svn which fixes this problem. Yup, right on

Re: [Numpy-discussion] latest svn version fails on Solaris

2007-08-22 Thread Stefan van der Walt
Hi Chris Do you have a Solaris machine that we can use as a client for the buildbot (this can be a desktop machine)? I didn't see this problem earlier, since all the other platforms built without problems. I also noticed that not all platforms execute the same number of tests, which is worrisome

Re: [Numpy-discussion] problem on testing numpy

2007-08-26 Thread Stefan van der Walt
On Fri, Aug 24, 2007 at 05:46:55PM +0200, Vivian Tini wrote: > Dear All, > > I have just installed NumPy and I am excited to test it. > Since I have no access as root then I installed Numpy in my home directory. > The following messages appears as I tried some commands: > > >>> import numpy > R

Re: [Numpy-discussion] numpy.random.multinomial() cannot handle zero's

2007-08-26 Thread Stefan van der Walt
Hi Michael On Sun, Aug 26, 2007 at 01:45:55PM +0100, Michael Nandris wrote: > Is there an easy way around this problem, that does not involve fixing the API > (like using NaN instead of 0.0)? > > >>> from numpy.random import multinomial > >>> multinomial(100,[ 0.2, 0.4, 0.1, 0.3 ]) > array([19, 4

Re: [Numpy-discussion] possibly ctypes related segfault

2007-08-27 Thread Stefan van der Walt
On Mon, Aug 27, 2007 at 08:21:43PM +0200, Lino Mastrodomenico wrote: > Hi Martin, > > 2007/8/27, Martin Wiechert <[EMAIL PROTECTED]>: > > I could not reproduce the bug in a debug build of python > > (--without-pymalloc) > > or on another machine. The crashing machine is an eight-way opteron. > >

Re: [Numpy-discussion] numpy.random.multinomial() cannot handle zero's

2007-08-27 Thread Stefan van der Walt
Hi Chris On Mon, Aug 27, 2007 at 11:07:00AM -0700, Christopher Barker wrote: > Is the kahan_sum closer? -- it should be, though compensated summation > is really for adding LOTS of numbers, for 4, it's pointless at best. > Anyway, binary floating point has its errors, and compensated summation

Re: [Numpy-discussion] numpy.random.multinomial() cannot handle zero's

2007-08-28 Thread Stefan van der Walt
On Mon, Aug 27, 2007 at 04:54:21PM -0700, Christopher Barker wrote: > Stefan van der Walt wrote: > > but using the Pyrex module, it yields true. You can find the code at > > > > http://mentat.za.net/html/refer/somesumbug.tar.bz2 > > That link appears to be broken.

Re: [Numpy-discussion] possibly ctypes related segfault

2007-08-28 Thread Stefan van der Walt
Hi Martin On Mon, Aug 27, 2007 at 02:57:28PM +0200, Martin Wiechert wrote: > I'm suffering from a strange segfault and would appreciate your help. > > I'm calling a small C function using ctypes / numpy.ctypeslib. The function > works in the sense that it returns correct results. After calling t

Re: [Numpy-discussion] possibly ctypes related segfault

2007-08-28 Thread Stefan van der Walt
On Tue, Aug 28, 2007 at 02:03:52PM +0200, Martin Wiechert wrote: > Here's the test script. I'm using it via execfile from an interactive > session, > so I can inspect (and crash with readline) afterwards. > > Here's how I compiled: > gcc > solver.c -fPIC -ggdb -shared -llapack -lf77blas -lcblas

Re: [Numpy-discussion] Bug in resize method?

2007-08-29 Thread Stefan van der Walt
Hi Charles On Wed, Aug 29, 2007 at 09:42:50AM -0600, Charles R Harris wrote: > Hi all, > > This looks like a bug to me. > > >>> a = arange(6).reshape(2,3) > >>> a.resize((3,3)) > Traceback (most recent call last): > File "", line 1, in > ValueError: cannot resize this array: it does not own

Re: [Numpy-discussion] Error code of NumpyTest()

2007-08-30 Thread Stefan van der Walt
On Thu, Aug 30, 2007 at 12:48:44PM +0300, Pearu Peterson wrote: > The svn version of test() function now returns TestResult object. > > So, test() calls in buildbot should read: > > import numpy,sys; sys.exit(not > numpy.test(verbosity=,level=).wasSuccessful()) > > Hopefully buildbot a

Re: [Numpy-discussion] [Fwd: Re: numpy revision 2680 causes segfault on Solaris]

2007-09-20 Thread Stefan van der Walt
Hi Chris Does this problem persist? I thought Eric's patch fixed it. Goes to show, we really need a Big Endian buildbot client. Cheers Stéfan On Thu, Sep 20, 2007 at 06:56:46PM -0400, Christopher Hanley wrote: > Hi Travis, > > The test failure was caused by a new test being added to the test

Re: [Numpy-discussion] [Fwd: Re: numpy revision 2680 causes segfault on Solaris]

2007-09-20 Thread Stefan van der Walt
Hi Chris On Thu, Sep 20, 2007 at 09:30:18PM -0400, Christopher Hanley wrote: > We have not seen any test failures on our big-endian Solaris system. > Did you re-implement the unit test that was failing. I was under the > impression that the fix had been to comment out the test the was > faili

[Numpy-discussion] ANN: SciPy 0.6.0

2007-09-21 Thread Stefan van der Walt
- Forwarded message from Jarrod Millman <[EMAIL PROTECTED]> - From: Jarrod Millman <[EMAIL PROTECTED]> To: SciPy Users List <[EMAIL PROTECTED]> Subject: [SciPy-user] ANN: SciPy 0.6.0 Reply-To: SciPy Users List <[EMAIL PROTECTED]> Date: Fri, 21 Sep 2007 02:04:32 -0700 Message-ID: <[EMAIL PR

Re: [Numpy-discussion] Using the numpy buildbot for svn branches ?

2007-09-24 Thread Stefan van der Walt
On Mon, Sep 24, 2007 at 09:05:57PM +0900, David Cournapeau wrote: > > It should have worked with the first solution. Did you try "trunk", to > > see if it works ? > It does not seem to work with only trunk. > > Is there somewhere the configuration file of the buildbot ? > > with this line for the

Re: [Numpy-discussion] indexing bug?

2007-09-28 Thread Stefan van der Walt
On Fri, Sep 28, 2007 at 03:07:30PM -0400, Nadia Dencheva wrote: > This should return an error and not silently truncate to int. Why do you say that? The current behaviour is consistent and well defined: a[x] == a[int(x)] We certainly can't change it now (just imagine all the code out there that

Re: [Numpy-discussion] Run length encoding of an ndarray

2007-10-02 Thread Stefan van der Walt
On Tue, Oct 02, 2007 at 01:36:02PM +0100, Michael Hoffman wrote: > I am trying to do a type of run-length encoding of a 2D array by axis. I > have an array of values arranged along two axes, state and position. > These are many (180, 3) uint8 arrays. > > I would like to have a list of tuples

Re: [Numpy-discussion] Default value in documentation

2007-10-02 Thread Stefan van der Walt
On Tue, Oct 02, 2007 at 12:25:58PM -0600, Charles R Harris wrote: > So label it optional and describe the default in prose in the parameter > description if necessary. While this is less descriptive for meaningful > defaults > (axis=-1), the case you show above is precisely suited t

Re: [Numpy-discussion] indexing bug?

2007-10-03 Thread Stefan van der Walt
On Wed, Oct 03, 2007 at 11:12:07AM -0400, Perry Greenfield wrote: > > On Sep 28, 2007, at 4:23 PM, Stefan van der Walt wrote: > >> On Fri, Sep 28, 2007 at 03:07:30PM -0400, Nadia Dencheva wrote: >>> This should return an error and not silently truncate to int. >>

Re: [Numpy-discussion] indexing bug?

2007-10-03 Thread Stefan van der Walt
On Wed, Oct 03, 2007 at 01:50:01PM -0400, Perry Greenfield wrote: > > Let me rephrase: we cannot change the API until 1.1, unless this is > > seen as a bug. To which other API changes are you referring? The > > style changes is a different matter entirely. > > The recent numpy and scipy threads

Re: [Numpy-discussion] Possible bug in numpy.trace()

2007-10-04 Thread Stefan van der Walt
Hi Donald On Thu, Oct 04, 2007 at 01:48:18AM +, Donald Fredkin wrote: > It appears that something peculiar is going on with the numpy function > trace(). The docs say that trace(A,...) is identical to A.trace(...). > Here is a test: > > A = arange(8).reshape((2,2,2)) > A.trace(0,1,2) > #[Out]

Re: [Numpy-discussion] Best representation for array of points, or, how to distinguish a Nx1 array of points from a Nx3 array of scalars

2007-10-04 Thread Stefan van der Walt
On Thu, Oct 04, 2007 at 11:47:40AM -0500, Robert Kern wrote: > Edson Tadeu wrote: > > > * Is there any field in the NumPy object where I can keep this > > information (the shape of the "element"), without creeping it with the > > dtype='(M,N)f8' representation I explained above? > > There isn't.

Re: [Numpy-discussion] Memory leak in vectorize ?

2007-10-08 Thread Stefan van der Walt
Hi Cryille On Mon, Oct 08, 2007 at 01:49:44AM +0200, Cyrille Rosset wrote: > Hello, > the following code seems to create a memory leak in Python. > (around 230 MB). > Any ideas what's wrong ? The relevant ticket is here: http://projects.scipy.org/scipy/numpy/ticket/570 Regards Stéfan __

Re: [Numpy-discussion] Iterate over all 1-dim views

2007-10-08 Thread Stefan van der Walt
On Sun, Oct 07, 2007 at 06:52:11AM -0400, Neal Becker wrote: > Suppose I have a function F(), which is defined for 1-dim arguments. If the > user passes an n>1 dim array, I want to apply F to each 1-dim view. > > For example, for a 2-d array, apply F to each row and return a 2-d result. > > For

Re: [Numpy-discussion] beginner question: rank-1 arrays

2007-10-08 Thread Stefan van der Walt
On Mon, Oct 08, 2007 at 11:00:39PM +0100, Robin wrote: > Hi, > > I am trying to implement a project in scipy. I think I am getting somewhere > finally. > > However in my code (I am converting from MATLAB) it is important to maintain > 2d > arrays, and keep the difference between row and column v

Re: [Numpy-discussion] convolution and wiener khinchin

2007-10-25 Thread Stefan van der Walt
Hi John The signals should be zero-padded, otherwise you get circular convolution: F = npy.fft.fft(r,len(r)+len(x)-1) X = npy.fft.fft(x,len(r)+len(x)-1) Y = F*X yi = npy.fft.ifft(Y)[:len(x)].real Also take a look at fftconv. Regards Stéfan On Thu, Oct 25, 2007 at 01:00:29PM -0500, John Hunter

Re: [Numpy-discussion] trailing max

2007-10-30 Thread Stefan van der Walt
On Tue, Oct 30, 2007 at 12:31:41PM -0500, John Hunter wrote: > In financial time series, it is very common to keep track of things > like a trailing N day max, trailing N day average, etc. Generally, > for a 1D array x, I'd like to be able to efficiently compute a new > len(x) vector where y[i] =

Re: [Numpy-discussion] MTL 4

2007-10-30 Thread Stefan van der Walt
On Tue, Oct 30, 2007 at 10:48:25AM -0600, Charles R Harris wrote: > Just a note that an alpha version of the hitherto mostly invisible > MTL4 library has been released. It is template based and has automatic > bindings to blas. You can download it from > http://www.osl.iu.edu/research/mtl/mtl4/. I

Re: [Numpy-discussion] weird numpy/pickle problem

2007-11-02 Thread Stefan van der Walt
On Fri, Nov 02, 2007 at 12:58:33PM -0400, Brian Blais wrote: > I encountered a peculiar numpy and pickle problem. My version: > > Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) Mac OS X Tiger > In [2]:numpy.__version__ > Out[2]:'1.0.4.dev3869' > > I pickle a matrix, and reload it. Some opera

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

2014-06-14 Thread Stefan van der Walt
On 2014-06-14 14:40:29, Nadav Horesh wrote: > This is most likely a documentation error since: > > In [7]: np.pad(a) > --- > TypeError Traceback (most recent call last) > in () > > 1 np.pad

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

2014-06-14 Thread Stefan van der Walt
On 2014-06-14 14:40:29, Nadav Horesh wrote: > TypeError: pad() missing 1 required positional argument: 'pad_width' I've added a PR here for further discussion: https://github.com/numpy/numpy/pull/4808 Stéfan ___ NumPy-Discussion mailing list NumPy-Dis

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Stefan van der Walt
Hi Warren On 2014-10-12 00:51:56, Warren Weckesser wrote: > A small wart in this API is the meaning of > > shuffle(a, independent=False, axis=None) > > It could be argued that the correct behavior is to leave the > array unchanged. I like the suggested changes. Since "independent" loses its m

Re: [Numpy-discussion] higher accuracy in diagonialzation

2014-10-27 Thread Stefan van der Walt
On 2014-10-27 10:37:58, Sunghwan Choi wrote: > I am now diagonalizing a 200-by-200 symmetric matrix. But the two methods, > scipy.linalg.eigh and numpy.linalg.eigh give significantly different result. > The results from two methods are different within 10^-4 order. One of them > is inaccurate or b

Re: [Numpy-discussion] Choosing between NumPy and SciPy functions

2014-10-28 Thread Stefan van der Walt
Hi Michael On 2014-10-27 15:26:58, D. Michael McFarland wrote: > What I would like to ask about is the situation this illustrates, where > both NumPy and SciPy provide similar functionality (sometimes identical, > to judge by the documentation). Is there some guidance on which is to > be preferr

Re: [Numpy-discussion] FFTS for numpy's FFTs (was: Re: Choosing between NumPy and SciPy functions)

2014-10-28 Thread Stefan van der Walt
On 2014-10-28 19:37:17, Daniele Nicolodi wrote: > On 28/10/14 16:50, David Cournapeau wrote: >> Nothing impossible (looks like Sony at least uses this code on windows: >> https://github.com/anthonix/ffts/issues/27#issuecomment-40204403), but >> not a 2 hours thing either. > > One of the downsides

Re: [Numpy-discussion] FFTS for numpy's FFTs (was: Re: Choosing between NumPy and SciPy functions)

2014-10-28 Thread Stefan van der Walt
On 2014-10-28 19:55:57, Daniele Nicolodi wrote: > On 28/10/14 18:44, Stefan van der Walt wrote: >> On 2014-10-28 19:37:17, Daniele Nicolodi wrote: >>> On 28/10/14 16:50, David Cournapeau wrote: >>>> Nothing impossible (looks like Sony at least uses this code on wi

Re: [Numpy-discussion] median filtering a masked array

2014-11-06 Thread Stefan van der Walt
On 2014-11-06 11:10:29, Daπid wrote: > On 5 November 2014 19:11, Moroney, Catherine M (398E) > wrote: >> What is the recommended way of doing a fast median filter on an array where >> only >> certain elements of the array need to be calculated? I'm trying to avoid a >> nested loop over all (I,J

Re: [Numpy-discussion] FFT of 2D array along last axis

2014-11-06 Thread Stefan van der Walt
Hi Brad On 2014-11-07 00:51:02, Brad Buran wrote: > On Windows 7 using Anaconda with numpy 1.9.1 I get False (indicating that > the FFT is not treating each row separately). When I test on a Ubuntu box > using numpy 1.9.1 I get True. Is this expected behavior? If I understand > the documentati

Re: [Numpy-discussion] Initializing array from buffer

2014-11-17 Thread Stefan van der Walt
Hi Andrea On 2014-11-16 19:42:09, Andrea Arteaga wrote: > My use case is the following: we have a some 3D arrays in our C++ > framework. The ordering of the elements in these arrays is neither C nor > Fortran style: it might be IJK (i.e. C style, 3rd dimension contiguous in > memory), KJI (i.e. F

Re: [Numpy-discussion] slicing an n-dimensional array

2014-12-03 Thread Stefan van der Walt
Hi Catherine On 2014-12-04 01:12:30, Moroney, Catherine M (398E) wrote: > I have an array "A" of shape (NX, NY, NZ), and then I have a second array "B" > of shape (NX, NY) > that ranges from 0 to NZ in value. > > I want to create a third array "C" of shape (NX, NY) that holds the > "B"-th slice

Re: [Numpy-discussion] slicing an n-dimensional array

2014-12-04 Thread Stefan van der Walt
On 2014-12-04 03:41:35, Jaime Fernández del Río wrote: > nx = np.arange(A.shape[0])[:, np.newaxis] > ny = np.arange(A.shape[1]) > C = A[nx, ny, B] That's the correct answer--in my answer I essentially wrote C = A[B] (== A[B, :, :]) which broadcasts the shape of B against the second and third di

[Numpy-discussion] Context manager for seterr

2014-12-14 Thread Stefan van der Walt
Hi all, Since the topic of context managers recently came up, what do you think of adding a context manager for seterr? with np.seterr(divide='ignore'): frac = num / denom Stéfan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://m

Re: [Numpy-discussion] Context manager for seterr

2014-12-14 Thread Stefan van der Walt
On 2014-12-15 02:23:18, Julian Taylor wrote: > with np.errstate(divide='ignore'): Perfect, thanks! Stéfan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Context manager for seterr

2014-12-14 Thread Stefan van der Walt
On 2014-12-15 02:23:18, Julian Taylor wrote: > already exists as np.errstate: > > with np.errstate(divide='ignore'): With 'ignore' a warning is still raised--is this by choice? >>> import numpy as np >>> x = np.array([0, 1, 2.]) >>> with np.errstate(divide='ignore'): ... x/x ... __main__:2:

[Numpy-discussion] ANN: scikit-image 0.11

2015-03-05 Thread Stefan van der Walt
rahan - Salvatore Scaramuzzino - Phil Schaf - Johannes Schönberger - Tim Seifert - Arve Seljebu - Steven Silvester - Julian Taylor - Matěj Týč - Alexey Umnov - Pratap Vardhan - Stefan van der Walt - Joshua Warner - Tony S Yu ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] appveyor CI

2015-03-05 Thread Stefan van der Walt
Hi Chuck On 2015-03-05 10:09:08, Charles R Harris wrote: > Anyone familiar with appveyor ? Is > this something we could use to test/build numpy on windows > machines? It is free for open source. We already use this for scikit-image, and you are welcome to grab the s

Re: [Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-10 Thread Stefan van der Walt
On 2015-05-10 14:46:12, Jaime Fernández del Río wrote: > Isn't what you are trying to build a cartesian product function? > There is a neat, efficient implementation of such a function in > StackOverflow, by our own pv.: > > http://stackoverflow.com/questions/1208118/using-numpy-to-build-an-arr

Re: [Numpy-discussion] Development workflow (not git tutorial)

2015-08-13 Thread Stefan van der Walt
On 2015-08-13 08:52:22, Anne Archibald wrote: > My current approach is to build an empty virtualenv, pip install > nose, and from the numpy root directory do "python setup.py > build_ext --inplace" and "python -c 'import numpy; > numpy.test()'". This works, for my stock system python, though I

Re: [Numpy-discussion] Development workflow (not git tutorial)

2015-08-14 Thread Stefan van der Walt
On 2015-08-14 10:08:11, Benjamin Root wrote: > I should also note that there is currently an open issue with > "pip install -e" and namespace packages. This has been reported > to matplotlib with regards to mpl_toolkits. Essentially, if you > have namespace packages, it doesn't get installed co

Re: [Numpy-discussion] Comments on governance proposal (was: Notes from the numpy dev meeting at scipy 2015)

2015-08-26 Thread Stefan van der Walt
Hi Matthew On 2015-08-26 10:50:47, Matthew Brett wrote: > In short, the core structure seems to be characteristically > associated with a conservatism and lack of vision that causes > the project to stagnate. Can you describe how a democratic governance structure would look? It's not clear f

Re: [Numpy-discussion] Comments on governance proposal (was: Notes from the numpy dev meeting at scipy 2015)

2015-08-27 Thread Stefan van der Walt
On 2015-08-27 11:06:10, Matthew Brett wrote: > So, in the spirit of fruitful discussion, can I ask what y'all > consider to be the current problems with working on numpy (other > than the technical ones). What is numpy doing well, and what > is it doing badly? What risks do we have to plan f

Re: [Numpy-discussion] Comments on governance proposal (was: Notes from the numpy dev meeting at scipy 2015)

2015-08-27 Thread Stefan van der Walt
Hi Sebastian On 2015-08-27 14:45:50, Sebastian Berg wrote: > Agreed. Are not PEP's/NEP's just that (and could possibly be > formalized more, not sure how much they are in the current > proposal) in some sense? Since they have a sponsor/author who > can be said to be assigned to it/responsibl

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stefan van der Walt
On 2015-08-28 11:51:47, Joseph Codadeen wrote: > my_1_minute_noise_with_gaps_truncated - Array len is > 2646070my_1_minute_noise_with_gaps - Array len is 2649674 In [6]: from sympy import factorint In [7]: max(factorint(2646070)) Out[7]: 367 In [8]: max(factorint(2649674)) Out[8]: 1324837

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stefan van der Walt
On 2015-08-28 16:20:33, Pierre-Andre Noel wrote: > If your sequence is not meant to be periodic (i.e., if after one > minute there is no reason why the signal should start back at > the beginning right away), then you should do zero-padding. And > while you zero-pad, you can zero-pad to a s

Re: [Numpy-discussion] Governance model request

2015-09-21 Thread Stefan van der Walt
On 2015-09-20 11:20:28, Travis Oliphant wrote: > I would recommend three possible adjustments to the steering council > concept. > > 1 - define a BDFL for the council. I would nominate chuck Harris > > 2 - limit the council to 3 people. I would nominate chuck, nathaniel, and > pauli. > > 3 - add

Re: [Numpy-discussion] Governance model request

2015-09-21 Thread Stefan van der Walt
On 2015-09-21 22:15:55, Bryan Van de Ven wrote: > Beyond that, what (even in a broad sense) is an example of a goal that > "Continuum might need" that would conceivably do detriment to the > NumPy community? That it be faster? Simpler to maintain? Easier to > extend? Integrate better with more OS

Re: [Numpy-discussion] Governance model request

2015-09-21 Thread Stefan van der Walt
Hi Brian On 2015-09-21 23:28:48, Bryan Van de Ven wrote: >> very hard to do. Currently, e.g., the community is not ready to adopt >> numba as part of the ufunc core. But it's been stated by some that, > > Who are you speaking for? The entire community? Under what mandate? I am speaking on beha

Re: [Numpy-discussion] Governance model request

2015-09-22 Thread Stefan van der Walt
Hi Travis On 2015-09-21 23:29:12, Travis Oliphant wrote: > 1) nobody believes that the community should be forced to adopt numba as > part of ufunc core yet --- but this could happen someday just as Cython is > now being adopted but was proposed 8 years ago that it "could be adopted" > That's a

Re: [Numpy-discussion] Governance model request

2015-09-22 Thread Stefan van der Walt
Hi Travis On 2015-09-22 03:44:12, Travis Oliphant wrote: > I'm actually offended that so many at BIDS seem eager to crucify my > intentions when I've done nothing but give away my time, my energy, my > resources, and my sleep to NumPy for many, many years.I guess if your > intent is to drive

Re: [Numpy-discussion] Governance model request

2015-09-23 Thread Stefan van der Walt
On 2015-09-23 13:36:35, Fernando Perez wrote: > On Wed, Sep 23, 2015 at 12:57 PM, Matthew Brett > wrote: > >> I see a severe reaction to perceived 'suspicion and innuendo', but I >> see no 'suspicion and innuendo'. Unless you mean that any suggestion >> of potential conflict of interest is suspi

Re: [Numpy-discussion] "Become an Open Source Contributor" workshop

2015-09-23 Thread Stefan van der Walt
Hi Jaime On 2015-09-23 14:06:08, Jaime Fernández del Río wrote: >3. If you have organized anything similar in the past, and have material >that I could use to, ahem, draw inspiration from, or recommendations to >make, or whatever, I'd love to hear from you. Here's the new developer w

Re: [Numpy-discussion] ANN: numtraits v0.2

2015-09-23 Thread Stefan van der Walt
Hi Thomas On 2015-09-23 09:39:00, Thomas Robitaille wrote: > We have released a small experimental package called numtraits that > builds on top of the traitlets package and provides a NumericalTrait > class that can be used to validate properties such as: This looks great! At the moment, a pip

Re: [Numpy-discussion] ANN: numtraits v0.2

2015-09-23 Thread Stefan van der Walt
On 2015-09-23 17:16:14, Nathaniel Smith wrote: >> This looks great! At the moment, a pip install tries to install a >> different version of NumPy, even though I already have the development >> version on my tree. > > FYI the alternative solution is to fix your local numpy install to > give pip an

Re: [Numpy-discussion] Tentative NumPy Tutorial inaccessible

2015-09-23 Thread Stefan van der Walt
On 2015-09-22 23:53:19, Nathaniel Smith wrote: > On Tue, Sep 22, 2015 at 10:58 PM, Andriy Yurchuk wrote: >> Hi! >> >> The Tentative NumPy Tutorial is no longer accessible by the URL >> http://wiki.scipy.org/Tentative_NumPy_Tutorial, it returns a 403. The link >> to this page is still on NumPy hom

Re: [Numpy-discussion] ANN: Numpy 1.10.0rc1 released.

2015-09-24 Thread Stefan van der Walt
On 2015-09-24 00:17:33, Jens Jørgen Mortensen wrote: > jensj@jordan:~$ python > Python 2.7.9 (default, Apr 2 2015, 15:33:21) > [GCC 4.9.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import numpy as np > >>> a = np.zeros((2, 2, 2)) > >>> b = np.zero

Re: [Numpy-discussion] Fwd: Numpy for data manipulation

2015-10-01 Thread Stefan van der Walt
On 2015-10-01 11:46:59, Alex Rogozhnikov wrote: > Hi, I have written some numpy tips and tricks I am using, which may be > interesting to you. > This is quite long reading, so I've splitted it into two parts: > > http://arogozhnikov.github.io/2015/09/29/NumpyTipsAndTricks1.html > http://arogozhni

[Numpy-discussion] Help wanted: implementation of 3D medial axis skeletonization

2015-11-06 Thread Stefan van der Walt
Hi all, I have been approached by a group that is interested in sponsoring the development of 3D skeletonization in scikit-image. One potential starting place would be: http://www.insight-journal.org/browse/publication/181 Is anyone interested in working on this? Please get in touch either on

Re: [Numpy-discussion] Which NumPy/Numpy/numpy spelling?

2016-08-30 Thread Stefan van der Walt
On Mon, Aug 29, 2016, at 04:43, m...@telenczuk.pl wrote: > The documentation is not consistent and it mixes both NumPy and Numpy. > For example, the reference manual uses both spellings in the introduction > paragraph (http://docs.scipy.org/doc/numpy/reference/): > > "This reference manual det

Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread Stefan van der Walt
On Wed, Aug 31, 2016, at 13:57, Jason Newton wrote: > Hey Ian - I hope I gave Cython a fair comment, but I have to add the > disclaimer that your capability to understand/implement those > solutions/workarounds in that project is greatly enhanced from your > knowing the innards of Cython from being

Re: [Numpy-discussion] Medians that ignore values

2008-09-19 Thread Stefan Van der Walt
On 19 Sep 2008, at 16:07 , Alan G Isaac wrote: > On 9/19/2008 4:35 AM David Cournapeau apparently wrote: >> I never use NaN as missing value > > What do you use? Masked arrays. Using NaN's for missing values is dangerous. You may do some operation, which generates invalid results, and then you

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

2007-11-12 Thread Stefan van der Walt
Since PIL Images now have array interfaces, it has become a lot simpler. The following should do the job: from numpy import array from PIL import Image def imread(fname,flatten=False): """Return a copy of a PIL image as a numpy array. *Parameters*: im : PIL image In

Re: [Numpy-discussion] Using arr.dtype.type to check byteorder-independed dtype fails for bool

2007-11-13 Thread Stefan van der Walt
Hi Sebastian On Tue, Nov 13, 2007 at 01:11:33PM +0100, Sebastian Haase wrote: > Hi, > I need to check the array dtype in a way that it is ignoring > differences coming only from big-endian vs. little-endian. Does N.issubdtype(first_dtype, second_dtype) work? Cheers Stéfan _

Re: [Numpy-discussion] Bug in arange dtype ">f" was: Using arr.dtype.type to check byteorder-independed dtype fails for bool

2007-11-13 Thread Stefan van der Walt
On Tue, Nov 13, 2007 at 02:53:32PM +0100, Sebastian Haase wrote: > trying to anwer your question with a quick "arange" test, I ran into > more confusion: > >> a = N.arange(.5, dtype=">f") > >>> `a.dtype` > 'dtype('float32')' > >>> a = N.arange(.5, dtype=" >>> `a.dtype` > 'dtype('float32')' Hrm, th

Re: [Numpy-discussion] numpy : your experiences?

2007-11-17 Thread Stefan van der Walt
On Sat, Nov 17, 2007 at 02:07:34AM -0500, Anne Archibald wrote: > On 16/11/2007, Rahul Garg <[EMAIL PROTECTED]> wrote: > > > It would be awesome if you guys could respond to some of the following > > questions : > > a) Can you guys tell me briefly about the kind of problems you are > > tackling wi

Re: [Numpy-discussion] Bug in arange dtype ">f" was: Using arr.dtype.type to check byteorder-independed dtype fails for bool

2007-11-17 Thread Stefan van der Walt
On Tue, Nov 13, 2007 at 02:53:32PM +0100, Sebastian Haase wrote: > On Nov 13, 2007 2:18 PM, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > Hi Sebastian > > > > On Tue, Nov 13, 2007 at 01:11:33PM +0100, Sebastian Haase wrote: > > > Hi, > > > I need

Re: [Numpy-discussion] SegFault/double free with simple array mask operation

2007-11-18 Thread Stefan van der Walt
On Sat, Nov 17, 2007 at 12:55:57PM +0100, Achim Gaedke wrote: > Achim Gaedke wrote: > > David Cournapeau wrote: > > > >> Could you open a ticket on the numpy trac system ? (I can confirm the bug) > >> > >> cheers, > >> > >> David > >> > >> > > It is Ticket #614 . The version information

Re: [Numpy-discussion] SegFault/double free with simple array mask operation

2007-11-18 Thread Stefan van der Walt
On Sun, Nov 18, 2007 at 11:18:10AM -1000, Eric Firing wrote: > Ticket #607 should be closed now also. It looks like I can't do that, > even though I created the ticket. > > I'm not sure whether it was the fix for #614 that did it, or whether it > is the code it referred to, but now a proper exc

[Numpy-discussion] freebsd patch

2007-11-23 Thread Stefan van der Walt
Hi all, Ticket 618 [1] proposes a patch to make numpy pass all tests on FreeBSD. Would anyone familiar with FreeBSD please glance over the patch, apply it and make sure that it works as intended? Thanks Stéfan [1] http://scipy.org/scipy/numpy/ticket/618 _

Re: [Numpy-discussion] Patch for numpy.i (not C89 compliant)

2007-11-23 Thread Stefan van der Walt
On Fri, Nov 23, 2007 at 10:24:07AM +0100, Matthieu Brucher wrote: > I submitted a ticket and then a patch for numpy.i > (http://projects.scipy.org/scipy/numpy/ticket/620). the problem is > that some typemaps use a C99 syntax whereas most C compiler still are > only C89 compliant (mainly Visual Stud

Re: [Numpy-discussion] my derived ndarray class object loses its attribute after a transpose()

2007-11-23 Thread Stefan van der Walt
Hi Sebastian On Fri, Nov 23, 2007 at 09:25:37AM +0100, Sebastian Haase wrote: > Hi, > this question might habe been answered before: > I have my own ndarray-derived class. I did this, so that I can add > another "custom attribute" -- let's say > arr.filename > All works very except, except when I

<    1   2   3   >