Re: [Numpy-discussion] New (old) function proposal.

2014-02-18 Thread Sebastian Berg
On Di, 2014-02-18 at 09:05 -0700, Charles R Harris wrote: Hi All, There is an old ticket, #1499, that suggest adding a segment_axis function. def segment_axis(a, length, overlap=0, axis=None, end='cut', endvalue=0): Generate a new array that chops the given array along the given

Re: [Numpy-discussion] Rethinking multiple dimensional indexing with sequences?

2014-02-18 Thread Sebastian Berg
On Di, 2014-02-18 at 17:09 +0100, Sebastian Berg wrote: Hey all, snip Now also NumPy commonly uses lists here to build up indexing tuples (since they are mutable), however would it really be so bad if we had to do `arr[tuple(slice_list)]` in the end to resolve this issue? So the proposal

Re: [Numpy-discussion] svd error checking vs. speed

2014-02-15 Thread Sebastian Berg
On Sa, 2014-02-15 at 16:37 -0500, alex wrote: Hello list, Here's another idea resurrection from numpy github comments that I've been advised could be posted here for re-discussion. The proposal would be to make np.linalg.svd more like scipy.linalg.svd with respect to input checking. The

Re: [Numpy-discussion] svd error checking vs. speed

2014-02-15 Thread Sebastian Berg
On Sa, 2014-02-15 at 17:35 -0500, josef.p...@gmail.com wrote: On Sat, Feb 15, 2014 at 5:12 PM, Skipper Seabold jsseab...@gmail.com wrote: On Sat, Feb 15, 2014 at 5:08 PM, josef.p...@gmail.com wrote: On Sat, Feb 15, 2014 at 4:56 PM, Sebastian Berg sebast...@sipsolutions.net wrote: On Sa

Re: [Numpy-discussion] svd error checking vs. speed

2014-02-15 Thread Sebastian Berg
On Sa, 2014-02-15 at 18:20 -0500, alex wrote: snip I'm not sure exactly what you mean by this. You are suggesting that if the svd fails with some kind of exception (possibly poorly or misleadingly worded) then it could be cleaned-up after the fact by checking the input, and that this would

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Sebastian Berg
On Mon, 2014-02-03 at 00:41 -0800, Dinesh Vadhia wrote: Does the numpy indexing refactorizing address the performance of fancy indexing highlighted in wes mckinney's blog some years back - http://wesmckinney.com/blog/?p=215 - where numpy.take() was shown to be preferable than fancy indexing?

Re: [Numpy-discussion] Indexing changes in 1.9

2014-02-03 Thread Sebastian Berg
On Sun, 2014-02-02 at 13:11 -0600, Travis Oliphant wrote: This sounds like a great and welcome work and improvements. Does it make sense to also do something about the behavior of advanced indexing when slices are interleaved between lists and integers. I know that jay borque has some

Re: [Numpy-discussion] Comparison changes

2014-01-25 Thread Sebastian Berg
On Sat, 2014-01-25 at 00:18 +, Nathaniel Smith wrote: On 25 Jan 2014 00:05, Sebastian Berg sebast...@sipsolutions.net wrote: Hi all, in https://github.com/numpy/numpy/pull/3514 I proposed some changes to the comparison operators. This includes: 1. Comparison with None

Re: [Numpy-discussion] vstack and hstack performance penalty

2014-01-24 Thread Sebastian Berg
On Fri, 2014-01-24 at 06:13 -0800, Dinesh Vadhia wrote: When using vstack or hstack for large arrays, are there any performance penalties eg. takes longer time-wise or makes a copy of an array during operation ? No, they all use concatenate. There are only constant overheads on top of the

[Numpy-discussion] Comparison changes

2014-01-24 Thread Sebastian Berg
Hi all, in https://github.com/numpy/numpy/pull/3514 I proposed some changes to the comparison operators. This includes: 1. Comparison with None will broadcast in the future, so that `arr == None` will actually compare all elements to None. (A FutureWarning for now) 2. I added that == and !=

Re: [Numpy-discussion] fromiter cannot create array of object - was: Creating an ndarray from an iterable, over sequences

2014-01-22 Thread Sebastian Berg
On Wed, 2014-01-22 at 07:58 +0100, Dr. Leo wrote: Hi, thanks. Both recarray and itertools.chain work just fine in the example case. However, the real purpose of this is to read strings from a large xml file into a pandas DataFrame. But fromiter cannot create arrays of dtype 'object'.

Re: [Numpy-discussion] accumulation operation

2014-01-22 Thread Sebastian Berg
On Wed, 2014-01-22 at 17:23 +, Ralf Juengling wrote: Executing the following code, import numpy as np a = np.zeros((3,)) w = np.array([0, 1, 0, 1, 2]) v = np.array([10.0, 1, 10.0, 2, 9]) a[w] += v I was expecting ‘a’ to be array([20., 3., 9.]. Instead I get

Re: [Numpy-discussion] A one-byte string dtype?

2014-01-21 Thread Sebastian Berg
On Tue, 2014-01-21 at 07:48 -0700, Charles R Harris wrote: On Tue, Jan 21, 2014 at 7:37 AM, Aldcroft, Thomas aldcr...@head.cfa.harvard.edu wrote: On Tue, Jan 21, 2014 at 8:55 AM, Charles R Harris charlesr.har...@gmail.com wrote:

[Numpy-discussion] Scalar result for field access -- Fix in minor release?

2013-12-19 Thread Sebastian Berg
Hey, fixing a corner case indexing regression in 1.8, I noticed/fixed accidentally this behavior of returning a scalar when indexing a 0-d array with fields (see also [1]): arr = np.array((1,), dtype=[('a', 'f8')]) arr['a'] # Returns an array arr[['a']] # Currently returns a *scalar* I think

Re: [Numpy-discussion] repeat array in a fake dim without stride_tricks ?

2013-12-18 Thread Sebastian Berg
On Tue, 2013-12-17 at 16:41 +0100, Pierre Haessig wrote: Le 13/12/2013 13:45, Sebastian Berg a écrit : What are the other options for such a repeat ? No, I don't think there are any other options. stride tricks are a bit hidden, since in many cases it is more dangerous than helping

Re: [Numpy-discussion] repeat array in a fake dim without stride_tricks ?

2013-12-13 Thread Sebastian Berg
Hey, On Thu, 2013-12-12 at 15:20 +0100, Pierre Haessig wrote: Hello, In order to repeat rows or columns of an array as http://stackoverflow.com/questions/1550130/cloning-row-or-column-vectors I can use np.repeat as suggested by pv. However, looking at the flags of the resulting array, data

Re: [Numpy-discussion] Deprecate boolean math operators?

2013-12-06 Thread Sebastian Berg
On Thu, 2013-12-05 at 23:02 -0500, josef.p...@gmail.com wrote: On Thu, Dec 5, 2013 at 10:56 PM, Alexander Belopolsky ndar...@mac.com wrote: On Thu, Dec 5, 2013 at 5:37 PM, Sebastian Berg sebast...@sipsolutions.net wrote: there was a discussion that for numpy booleans math operators

Re: [Numpy-discussion] Deprecate boolean math operators?

2013-12-06 Thread Sebastian Berg
On Fri, 2013-12-06 at 15:30 -0500, josef.p...@gmail.com wrote: On Fri, Dec 6, 2013 at 2:59 PM, Nathaniel Smith n...@pobox.com wrote: On Fri, Dec 6, 2013 at 11:55 AM, Alexander Belopolsky ndar...@mac.com wrote: On Fri, Dec 6, 2013 at 1:46 PM, Alan G Isaac alan.is...@gmail.com wrote:

[Numpy-discussion] Deprecate boolean math operators?

2013-12-05 Thread Sebastian Berg
Hey, there was a discussion that for numpy booleans math operators +,-,* (and the unary -), while defined, are not very helpful. I have set up a quick PR with start (needs some fixes inside numpy still): https://github.com/numpy/numpy/pull/4105 The idea is to deprecate these, since the binary

Re: [Numpy-discussion] nasty bug in 1.8.0??

2013-12-02 Thread Sebastian Berg
On Mon, 2013-12-02 at 14:51 -0500, Neal Becker wrote: The software I'm using, which is https://github.com/ndarray/ndarray does depend on this. Am I the only one who thinks that this behavior is not desirable? Well, this is not meant to be the way for a release version of numpy. The

Re: [Numpy-discussion] nasty bug in 1.8.0??

2013-12-02 Thread Sebastian Berg
On Mon, 2013-12-02 at 18:15 -0500, Jim Bosch wrote: If your arrays are contiguous, you don't really need the strides (use the itemsize instead). How is ndarray broken by this? ndarray is broken by this change because it expects the stride to be a multiple of the itemsize (I think; I'm just

Re: [Numpy-discussion] getting the equivalent complex dtype from a real or int array

2013-10-29 Thread Sebastian Berg
On Tue, 2013-10-29 at 16:47 +, Henry Gomersall wrote: Is there a way to extract the size of array that would be created by doing 1j*array? There is np.result_type. It does the handling of scalars as normal, dtypes will be handled like arrays (scalars are allowed to lose precision). -

Re: [Numpy-discussion] Using array mask swaps array axes

2013-10-16 Thread Sebastian Berg
On Wed, 2013-10-16 at 11:50 -0400, Benjamin Root wrote: On Wed, Oct 16, 2013 at 11:39 AM, Chad Kidder cckid...@gmail.com wrote: Just found what should be a bug in 1.7.1. I'm running python(x,y) on windows here: dataMatrix[ii,:,mask].shape

Re: [Numpy-discussion] 1.8.0rc1

2013-10-02 Thread Sebastian Berg
On Wed, 2013-10-02 at 10:04 +0100, Nathaniel Smith wrote: This is a complicated issue to describe but i think the bottom line is that the test is just wonky here. the behaviour it's checking for is: wrong in old numpy, but we do it anyway (bug) wrong in current numpy without RELAXED_STRIDES,

Re: [Numpy-discussion] 1.8.0rc1

2013-10-02 Thread Sebastian Berg
On Wed, 2013-10-02 at 12:54 +0200, Sebastian Berg wrote: On Wed, 2013-10-02 at 10:04 +0100, Nathaniel Smith wrote: This is a complicated issue to describe but i think the bottom line is that the test is just wonky here. the behaviour it's checking for is: wrong in old numpy, but we do

Re: [Numpy-discussion] 1.8.0rc1

2013-10-01 Thread Sebastian Berg
On Tue, 2013-10-01 at 12:00 +0200, Jens Jørgen Mortensen wrote: Den 30-09-2013 17:17, Charles R Harris skrev: Hi All, NumPy 1.8.0rc1 is up now on sourceforge .The binary builds are included except for Python 3.3 on windows, which will arrive later. Many thanks to Ralf for the

[Numpy-discussion] Indexing changes/deprecations

2013-09-27 Thread Sebastian Berg
Hey, since I am working on the indexing. I was wondering about a few smaller things: * 0-d boolean array, `np.array(0)[True]` (will work now) would give np.array([0]) as a copy, instead of the original array. I guess I could add a FutureWarning or so, but I am not sure and overall

Re: [Numpy-discussion] Indexing changes/deprecations

2013-09-27 Thread Sebastian Berg
On Fri, 2013-09-27 at 09:26 -0400, Benjamin Root wrote: snip Boolean indexing could use a facelift. First, consider the following (albeit minor) annoyance: Done. Well will be deprecation warnings for the time being, though. snip Next, it would be nice if boolean indexing returned a

Re: [Numpy-discussion] Indexing changes/deprecations

2013-09-27 Thread Sebastian Berg
On Fri, 2013-09-27 at 08:45 -0700, Jaime Fernández del Río wrote: On Fri, Sep 27, 2013 at 5:27 AM, Sebastian Berg sebast...@sipsolutions.net wrote: And most importantly, is there any behaviour thing in the index machinery that is bugging you, which I may

Re: [Numpy-discussion] Min Error

2013-09-22 Thread Sebastian Berg
On Sun, 2013-09-22 at 10:21 -0400, David Reed wrote: Hi, I am getting a strange error when finding the minimum of a matrix. The weird thing is I get this while running within iPython shell, and if I do %debug and go to the line where this fails and run the command `a = np.min(D,

Re: [Numpy-discussion] Min Error

2013-09-22 Thread Sebastian Berg
22, 2013 at 10:42 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Sun, 2013-09-22 at 10:21 -0400, David Reed wrote: Hi, I am getting a strange error when finding the minimum

Re: [Numpy-discussion] ANN: Numpy 1.8.0 beta 1 release

2013-09-05 Thread Sebastian Berg
On Wed, 2013-09-04 at 22:08 -0700, Christoph Gohlke wrote: On 9/1/2013 9:54 AM, Charles R Harris wrote: snip Hello, is this IndexError intentional in numpy 1.8? Matplotlib 1.3 fails some tests because of this. numpy.zeros(1)[[0], :] Traceback (most recent call last): File

Re: [Numpy-discussion] What is a numpy.long type?

2013-08-23 Thread Sebastian Berg
On Fri, 2013-08-23 at 07:59 -0700, Chris Barker - NOAA Federal wrote: On Aug 22, 2013, at 11:57 PM, David Cournapeau courn...@gmail.com wrote: snip arch -32 python -c import numpy as np; print np.dtype(np.int); print np.dtype(np.long) int32 int64 So this is giving us a 64 bit

Re: [Numpy-discussion] Allow == and != to raise errors

2013-07-23 Thread Sebastian Berg
On Sat, 2013-07-13 at 11:28 -0400, josef.p...@gmail.com wrote: On Sat, Jul 13, 2013 at 9:14 AM, Nathaniel Smith n...@pobox.com wrote: snip I'm now +1 on the exception that Sebastian proposed. I like consistency, and having a more straightforward mental model of the numpy behavior for

Re: [Numpy-discussion] .flat

2013-07-23 Thread Sebastian Berg
On Tue, 2013-07-23 at 10:22 -0600, Charles R Harris wrote: On Tue, Jul 23, 2013 at 8:46 AM, Pauli Virtanen p...@iki.fi wrote: 23.07.2013 17:34, Benjamin Root kirjoitti: [clip] Don't assume .flat is not commonly used. A common idiom in matlab is

Re: [Numpy-discussion] Bringing order to higher dimensional operations

2013-07-19 Thread Sebastian Berg
On Fri, 2013-07-19 at 16:31 +0100, Nathaniel Smith wrote: On Thu, Jul 18, 2013 at 2:23 PM, Sebastian Berg sebast...@sipsolutions.net wrote: It is so difficult because of the fact that dot is basically a combination of many functions: o vector * vector - vector o vector * matrix

Re: [Numpy-discussion] Bringing order to higher dimensional operations

2013-07-19 Thread Sebastian Berg
On Fri, 2013-07-19 at 16:14 +0100, Nathaniel Smith wrote: On Thu, Jul 18, 2013 at 2:23 PM, Sebastian Berg sebast...@sipsolutions.net wrote: On Thu, 2013-07-18 at 13:52 +0100, Nathaniel Smith wrote: Hi all, snip What I mean is: Suppose we wrote a gufunc for 'sum', where the intrinsic

Re: [Numpy-discussion] Bringing order to higher dimensional operations

2013-07-18 Thread Sebastian Berg
On Thu, 2013-07-18 at 13:52 +0100, Nathaniel Smith wrote: Hi all, snip So: QUESTION 1: does that sound right: that in a perfect world, the current gufunc convention would be the only one, and that's what we should work towards, at least in the cases where that's possible? Sounds

Re: [Numpy-discussion] Allow == and != to raise errors

2013-07-15 Thread Sebastian Berg
! Ben Root On Fri, Jul 12, 2013 at 8:38 AM, Sebastian Berg sebast...@sipsolutions.net wrote: Hey, the array comparisons

Re: [Numpy-discussion] What should be the result in some statistics corner cases?

2013-07-15 Thread Sebastian Berg
On Mon, 2013-07-15 at 07:52 -0600, Charles R Harris wrote: On Sun, Jul 14, 2013 at 3:35 PM, Charles R Harris charlesr.har...@gmail.com wrote: snip For nansum, I would expect 0 even in the case of all nans. The point

Re: [Numpy-discussion] What should be the result in some statistics corner cases?

2013-07-15 Thread Sebastian Berg
On Mon, 2013-07-15 at 08:47 -0600, Charles R Harris wrote: On Mon, Jul 15, 2013 at 8:34 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mon, 2013-07-15 at 07:52 -0600, Charles R Harris wrote: On Sun, Jul 14, 2013 at 3:35 PM, Charles R Harris

Re: [Numpy-discussion] Allow == and != to raise errors

2013-07-15 Thread Sebastian Berg
On Mon, 2013-07-15 at 17:12 +0200, bruno Piguet wrote: 2013/7/15 Frédéric Bastien no...@nouiz.org Just a question, should == behave like a ufunc or like python == for tuple? That's what I was also wondering. I am not sure I understand the question. Of

Re: [Numpy-discussion] Allow == and != to raise errors

2013-07-13 Thread Sebastian Berg
On Fri, 2013-07-12 at 19:29 -0400, josef.p...@gmail.com wrote: On Fri, Jul 12, 2013 at 3:35 PM, Frédéric Bastien no...@nouiz.org wrote: I also don't like that idea, but I'm not able to come to a good reasoning like Benjamin. I don't see advantage to this change and the reason isn't good

[Numpy-discussion] Allow == and != to raise errors

2013-07-12 Thread Sebastian Berg
Hey, the array comparisons == and != never raise errors but instead simply return False for invalid comparisons. The main example are arrays of non-matching dimensions, and object arrays with invalid element-wise comparisons: In [1]: np.array([1,2,3]) == np.array([1,2]) Out[1]: False In [2]:

Re: [Numpy-discussion] np.ma.argmax not respecting the mask?

2013-07-09 Thread Sebastian Berg
On Tue, 2013-07-09 at 15:14 +0200, Stéfan van der Walt wrote: On Tue, Jul 9, 2013 at 2:55 PM, Chao YUE chaoyue...@gmail.com wrote: I am using 1.7.1 version of numpy and np.ma.argmax is not repecting the mask? In [96]: d3 Out[96]: masked_array(data = [[-- -- -- -- 4] [5 -- 7 8

Re: [Numpy-discussion] Fancy indexing oddity

2013-07-03 Thread Sebastian Berg
On Tue, 2013-07-02 at 20:44 -0700, Bradley M. Froehle wrote: A colleague just showed me this indexing behavior and I was at a loss to explain what was going on. Can anybody else chime in and help me understand this indexing behavior? import numpy as np np.__version__ '1.7.1'

Re: [Numpy-discussion] np.insert with axis=-1

2013-07-01 Thread Sebastian Berg
On Mon, 2013-07-01 at 14:11 +0200, Félix Hartmann wrote: Hi all, I recently upgraded from Numpy 1.6.2 to 1.7.1 on my Debian testing, and then got a bug in a program that was previously working. It turned out that the problem comes from the np.insert function when the argument `axis=-1` is

Re: [Numpy-discussion] np.insert with axis=-1

2013-07-01 Thread Sebastian Berg
On Mon, 2013-07-01 at 17:54 +0200, Sebastian Berg wrote: On Mon, 2013-07-01 at 14:11 +0200, Félix Hartmann wrote: Hi all, I recently upgraded from Numpy 1.6.2 to 1.7.1 on my Debian testing, and then got a bug in a program that was previously working. It turned out that the problem

Re: [Numpy-discussion] NumPy sprints @ scipy 2013

2013-06-28 Thread Sebastian Berg
On Fri, 2013-06-28 at 07:44 -0500, David Cournapeau wrote: Hi there, It is very last minute, but I have set up a page to coordinate a bit scipy 2013's numpy sprints (Friday 28 and Saturday 29th, although I may not be there the second day). Depending on the audience, I will also look

Re: [Numpy-discussion] slicing with boolean in numpy master

2013-06-26 Thread Sebastian Berg
On Wed, 2013-06-26 at 11:30 -0400, josef.p...@gmail.com wrote: Is there a change in the behavior of boolean slicing in current master? Yes, but I think this is probably a bug in statsmodel. I would expect you should be using ... and not : here, because : requires the dimension to actually

Re: [Numpy-discussion] slicing with boolean in numpy master

2013-06-26 Thread Sebastian Berg
On Wed, 2013-06-26 at 12:52 -0400, josef.p...@gmail.com wrote: On Wed, Jun 26, 2013 at 12:01 PM, Sebastian Berg sebast...@sipsolutions.net wrote: On Wed, 2013-06-26 at 11:30 -0400, josef.p...@gmail.com wrote: Is there a change in the behavior of boolean slicing in current master? Yes

[Numpy-discussion] Not checking github

2013-06-15 Thread Sebastian Berg
Just to note, I disabled most github notifications for time reasons for the next months, so if something pops up that you think I should look at, use @mention. - Sebastian ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Memory leak

2013-06-13 Thread Sebastian Berg
On Thu, 2013-06-13 at 16:50 +0200, Pietro Bonfa' wrote: Dear Numpy users, I have a memory leak in my code. A simple way to reproduce my problem is: import numpy class test(): def __init__(self): pass def t(self): temp = numpy.zeros([200,100,100]) A

Re: [Numpy-discussion] Will transpose ever need to copy data?

2013-06-12 Thread Sebastian Berg
On Tue, 2013-06-11 at 09:24 -0700, Jaime Fernández del Río wrote: I noticed today that the documentation for np.transpose states, for the return value, that A view is returned whenever possible. I guess a subclass could cause a copy (the code looks like subclassing doing something fancy is

Re: [Numpy-discussion] adding booleans

2013-06-08 Thread Sebastian Berg
On Sat, 2013-06-08 at 00:48 +0100, Nathaniel Smith wrote: On 7 Jun 2013 21:58, josef.p...@gmail.com wrote: Interesting observation, (while lurking on a pull request) np.add.reduce(np.arange(5)3) 3 np.add((np.arange(5)3), (np.arange(5)3)) array([ True, True, True, False, False],

Re: [Numpy-discussion] adding booleans

2013-06-08 Thread Sebastian Berg
On Fri, 2013-06-07 at 20:29 -0400, josef.p...@gmail.com wrote: On Fri, Jun 7, 2013 at 8:08 PM, josef.p...@gmail.com wrote: On Fri, Jun 7, 2013 at 7:48 PM, Nathaniel Smith n...@pobox.com wrote: On 7 Jun 2013 21:58, josef.p...@gmail.com wrote: Interesting observation, (while lurking on a

Re: [Numpy-discussion] np.asarray atleast_float64 ?

2013-06-08 Thread Sebastian Berg
On Sat, 2013-06-08 at 08:52 -0400, josef.p...@gmail.com wrote: Is there anything to require a numpy array with a minimum numeric dtype? To avoid lower precision calculations and be upwards compatible, something like x = np.asarray(x, =np.float64) np.result_type(arr, np.float64) uses the

Re: [Numpy-discussion] easy way to collapse the last two dimension of an array?

2013-06-03 Thread Sebastian Berg
On Mon, 2013-06-03 at 10:44 +0200, Chao YUE wrote: Dear all, I have an array with 4 dim: In [24]: dd.shape Out[24]: (12, 13, 120, 170) I would like to collapse the last two dim for applying np.sum(axis=-1) If you use Numpy = 1.7. you can also just use dd.sum(axis=(-1,-2)) - Sebastian

Re: [Numpy-discussion] numpy tests errors and failures

2013-06-02 Thread Sebastian Berg
On Sat, 2013-06-01 at 17:47 -0600, Charles R Harris wrote: On Sat, Jun 1, 2013 at 4:50 PM, Warren Weckesser warren.weckes...@gmail.com wrote: I'm getting a failure and two errors with the latest master branch: $ python -c import numpy; numpy.test('full')

Re: [Numpy-discussion] Effect of deprecating non-integers for integer function arguments

2013-06-01 Thread Sebastian Berg
On Fri, 2013-05-31 at 16:32 -0400, josef.p...@gmail.com wrote: On Fri, May 31, 2013 at 2:08 PM, Sebastian Berg sebast...@sipsolutions.net wrote: Hi, the current numpy master has deprecated non-integers for the use of indexing (not-fancy yet). However I think this should be moved further

[Numpy-discussion] Effect of deprecating non-integers for integer function arguments

2013-05-31 Thread Sebastian Berg
Hi, the current numpy master has deprecated non-integers for the use of indexing (not-fancy yet). However I think this should be moved further down in the numpy machinery which means that the conversion utils provided by numpy would generally raise warnings for non-integers. This means that for

Re: [Numpy-discussion] slight MapIter change

2013-05-13 Thread Sebastian Berg
into problems. - Sebastian thanks Fred On Sat, May 11, 2013 at 11:41 AM, Sebastian Berg sebast...@sipsolutions.net wrote: Hey, (this is only interesting if you know what MapIter and actually use it) In case anyone already uses

Re: [Numpy-discussion] somewhat less stupid problem with 0-d arrays

2013-05-11 Thread Sebastian Berg
On Fri, 2013-05-10 at 19:57 -0400, Neal Becker wrote: It would be convenient if in arithmetic 0-d arrays were just ignored - it would seem to me to be convenient in generic code where a degenerate array is treated as nothing Small naming detail. A 0-d array is an array with exactly one

Re: [Numpy-discussion] somewhat less stupid problem with 0-d arrays

2013-05-11 Thread Sebastian Berg
On Sat, 2013-05-11 at 08:30 -0400, Neal Becker wrote: Sebastian Berg wrote: On Fri, 2013-05-10 at 19:57 -0400, Neal Becker wrote: It would be convenient if in arithmetic 0-d arrays were just ignored - it would seem to me to be convenient in generic code where a degenerate array

Re: [Numpy-discussion] __array_priority__ don't work for gt, lt, ... operator

2013-05-10 Thread Sebastian Berg
On Fri, 2013-05-10 at 15:35 -0400, Frédéric Bastien wrote: I'm trying to do it, but each time I want to test something, it takes a long time to rebuild numpy to test it. Is there a way to don't recompile everything for each test? Are you using current master? It defaults to use

Re: [Numpy-discussion] Really cruel draft of vbench setup for NumPy (.add.reduce benchmarks since 2011)

2013-05-07 Thread Sebastian Berg
On Mon, 2013-05-06 at 12:11 -0400, Yaroslav Halchenko wrote: On Mon, 06 May 2013, Sebastian Berg wrote: if you care to tune it up/extend and then I could fire it up again on that box (which doesn't do anything else ATM AFAIK). Since majority of time is spent actually building it (did

Re: [Numpy-discussion] numpy ring buffer

2013-05-06 Thread Sebastian Berg
On Mon, 2013-05-06 at 11:39 +0200, Daniele Nicolodi wrote: On 06/05/2013 11:01, Robert Kern wrote: np.roll() copies all of the data every time. It does not return a view. Are you sure about that? Either I'm missing something, or it returns a view in my testing (with a fairly old numpy,

Re: [Numpy-discussion] Really cruel draft of vbench setup for NumPy (.add.reduce benchmarks since 2011)

2013-05-06 Thread Sebastian Berg
On Mon, 2013-05-06 at 10:32 -0400, Yaroslav Halchenko wrote: On Wed, 01 May 2013, Sebastian Berg wrote: btw -- is there something like panda's vbench for numpy? i.e. where it would be possible to track/visualize such performance improvements/hits? Sorry if it seemed harsh

Re: [Numpy-discussion] nanmean(), nanstd() and other missing functions for 1.8

2013-05-02 Thread Sebastian Berg
On Thu, 2013-05-02 at 07:03 -0400, Nathaniel Smith wrote: On 1 May 2013 23:12, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, May 1, 2013 at 7:10 PM, Benjamin Root ben.r...@ou.edu wrote: So, to summarize the thread so far: Consensus: np.nanmean() np.nanstd()

Re: [Numpy-discussion] could anyone check on a 32bit system?

2013-05-01 Thread Sebastian Berg
On Tue, 2013-04-30 at 22:20 -0700, Matthew Brett wrote: Hi, On Tue, Apr 30, 2013 at 9:16 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Tue, Apr 30, 2013 at 8:08 PM, Yaroslav Halchenko li...@onerussian.com wrote: could anyone on 32bit system with fresh numpy (1.7.1) test

Re: [Numpy-discussion] could anyone check on a 32bit system?

2013-05-01 Thread Sebastian Berg
On Wed, 2013-05-01 at 15:29 -0400, Yaroslav Halchenko wrote: just for completeness... I haven't yet double checked if I have done it correctly but here is the bisected commit: aed9925a9d5fe9a407d0ca2c65cb577116c4d0f1 is the first bad commit commit aed9925a9d5fe9a407d0ca2c65cb577116c4d0f1

Re: [Numpy-discussion] could anyone check on a 32bit system?

2013-05-01 Thread Sebastian Berg
On Wed, 2013-05-01 at 16:37 -0400, Yaroslav Halchenko wrote: On Wed, 01 May 2013, Sebastian Berg wrote: There really is no point discussing here, this has to do with numpy doing iteration order optimization, and you actually *want* this. Lets for a second assume that the old behavior

Re: [Numpy-discussion] int to binary

2013-04-29 Thread Sebastian Berg
On Mon, 2013-04-29 at 11:15 -0400, josef.p...@gmail.com wrote: Is there a available function to convert an int to binary representation as sequence of 0 and 1? Maybe unpackbits/packbits? It only supports the uint8 type, but you can view anything as that (being aware of endianess where

Re: [Numpy-discussion] 1.8 release

2013-04-25 Thread Sebastian Berg
On Thu, 2013-04-25 at 09:16 -0600, Charles R Harris wrote: Hi All, I think it is time to start the runup to the 1.8 release. I don't know of any outstanding blockers but if anyone has a PR/issue that they feel needs to be in the next Numpy release now is the time to make it known. Sounds

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Sebastian Berg
On Thu, 2013-04-25 at 14:04 -0600, Charles R Harris wrote: On Thu, Apr 25, 2013 at 1:51 PM, josef.p...@gmail.com wrote: On Thu, Apr 25, 2013 at 3:40 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel

Re: [Numpy-discussion] Vectorized percentile function in Numpy (PR #2970)

2013-04-24 Thread Sebastian Berg
On Tue, 2013-04-23 at 23:33 -0400, josef.p...@gmail.com wrote: On Tue, Apr 23, 2013 at 6:16 PM, Sebastian Berg sebast...@sipsolutions.net wrote: On Tue, 2013-04-23 at 12:13 -0500, Jonathan Helmus wrote: Back in December it was pointed out on the scipy-user list[1] that numpy has

Re: [Numpy-discussion] MapIter api

2013-04-23 Thread Sebastian Berg
that you don't remove the part that we use for the next 1.8 release. thanks Frédéric On Tue, Apr 16, 2013 at 9:54 AM, Nathaniel Smith n...@pobox.com wrote: On Mon, Apr 15, 2013 at 5:29 PM, Sebastian Berg sebast...@sipsolutions.net wrote: Hey

Re: [Numpy-discussion] Vectorized percentile function in Numpy (PR #2970)

2013-04-23 Thread Sebastian Berg
moved to enhancing the Numpy version with Pull Request 2970 [3]. With some input from Sebastian Berg the percentile function was rewritten with further vectorization, but neither of us felt fully comfortable with the final product. Can someone look at implementation in the PR and suggest

[Numpy-discussion] KeepDims flag?

2013-04-21 Thread Sebastian Berg
Hi, just something that has been spooking around in my mind. Considering that matrix indexing does not really support fancy indexing, I was wondering about introducing a KeepDims flag. Maybe it is not worth it, at least not unless other subclasses could make use of it, too. And a big reason for

Re: [Numpy-discussion] numpy scalars and savez -- bug?

2013-04-19 Thread Sebastian Berg
On Fri, 2013-04-19 at 08:03 -0700, Chris Barker - NOAA Federal wrote: On Apr 18, 2013, at 11:33 PM, Nathaniel Smith n...@pobox.com wrote: On 18 Apr 2013 01:29, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: This has been annoying, particular as rank-zero scalars are kind

Re: [Numpy-discussion] numpy scalars and savez -- bug?

2013-04-19 Thread Sebastian Berg
On Fri, 2013-04-19 at 23:02 +0530, Robert Kern wrote: On Fri, Apr 19, 2013 at 9:40 PM, Sebastian Berg sebast...@sipsolutions.net wrote: Fun fact, array[()] will convert a 0-d array to a scalar, but do nothing (or currently create a view) for other arrays. Which is actually a good

[Numpy-discussion] Index Parsing redo

2013-04-18 Thread Sebastian Berg
Hey, so I ignored trying to redo MapIter (likely it is lobotomized at this time though). But actually got a working new index parsing (still needs cleanup, etc.). Also some of the fast paths are not yet put back. For most pure integer indices it got a bit slower, if it actually gets too much one

Re: [Numpy-discussion] datetime64 1970 issue

2013-04-17 Thread Sebastian Berg
On Wed, 2013-04-17 at 09:07 -0700, Chris Barker - NOAA Federal wrote: On Wed, Apr 17, 2013 at 9:04 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Tue, Apr 16, 2013 at 8:23 PM, Zachary Ploskey zplos...@gmail.com wrote: I'd say we need some more unit-tests! speaking of

Re: [Numpy-discussion] MapIter api

2013-04-16 Thread Sebastian Berg
On Mon, 2013-04-15 at 13:36 -0600, Charles R Harris wrote: On Mon, Apr 15, 2013 at 1:27 PM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mon, 2013-04-15 at 11:16 -0600, Charles R Harris wrote: On Mon, Apr 15, 2013 at 10:29 AM, Sebastian Berg

[Numpy-discussion] MapIter api

2013-04-15 Thread Sebastian Berg
Hey, the MapIter API has only been made public in master right? So it is no problem at all to change at least the mapiter struct, right? I got annoyed at all those special cases that make things difficult to get an idea where to put i.e. to fix the boolean array-like stuff. So actually started

Re: [Numpy-discussion] MapIter api

2013-04-15 Thread Sebastian Berg
On Mon, 2013-04-15 at 11:16 -0600, Charles R Harris wrote: On Mon, Apr 15, 2013 at 10:29 AM, Sebastian Berg sebast...@sipsolutions.net wrote: Hey, the MapIter API has only been made public in master right? So it is no problem at all to change

Re: [Numpy-discussion] Random number generation and testing across different OS's.

2013-04-12 Thread Sebastian Berg
On Fri, 2013-04-12 at 10:50 -0400, Andrew Nelson wrote: I have written a differential evolution optimiser that i use for curvefitting. As a genetic optimisation technique it is stochastic and relies heavily on random number generators to do the minimisation. As part of the

[Numpy-discussion] Non-Integer deprecations

2013-04-12 Thread Sebastian Berg
Hey all, just revisiting non-integer (index) deprecations (basically https://github.com/numpy/numpy/pull/2891). I believe for all natural integer arguments, it is correct to do a deprecation if the input is not an integer. (Technically most of these go through PyArray_PyIntAsIntp, and if not

Re: [Numpy-discussion] Scheduling the 1.7.1 and 1.8 releases

2013-04-11 Thread Sebastian Berg
On Wed, 2013-03-06 at 11:43 -0700, Charles R Harris wrote: Hi All, snip The development branch has been accumulating stuff since last summer, I suggest we look to get it out in May, branching at the end of this month. Hey, maybe it is a bit early, but I was wondering. What are the things

Re: [Numpy-discussion] OpenOpt Suite release 0.45

2013-04-10 Thread Sebastian Berg
On Wed, 2013-04-10 at 11:45 +0200, Sebastian Berg wrote: On Wed, 2013-04-10 at 11:54 +0300, Dmitrey wrote: On 04/10/2013 10:31 AM, Robert Kern wrote: snip This is all good and nice, but Robert is still right. For dictionaries to work predictable you need to ensure two things. First

Re: [Numpy-discussion] OpenOpt Suite release 0.45

2013-04-10 Thread Sebastian Berg
On Wed, 2013-04-10 at 11:45 +0200, Sebastian Berg wrote: On Wed, 2013-04-10 at 11:54 +0300, Dmitrey wrote: On 04/10/2013 10:31 AM, Robert Kern wrote: You think comparing tracked bug counts across different projects means anything? That's adorable. I admire your diligence at addressing

Re: [Numpy-discussion] einsum and broadcasting

2013-04-05 Thread Sebastian Berg
On Thu, 2013-04-04 at 16:56 +0300, Jaakko Luttinen wrote: I don't quite understand how einsum handles broadcasting. I get the following error, but I don't understand why: In [8]: import numpy as np In [9]: A = np.arange(12).reshape((4,3)) In [10]: B = np.arange(6).reshape((3,2)) In [11]:

Re: [Numpy-discussion] Raveling, reshape order keyword unnecessarily confuses index and memory ordering

2013-04-04 Thread Sebastian Berg
On Thu, 2013-04-04 at 12:40 -0700, Matthew Brett wrote: Hi, snip So - to restate in other words - this : np.reshape(a, (3, 4), order='F') could reasonably mean one of two orthogonal things 1) Retrieve data from the array using first-to-last indexing, return any memory layout you

Re: [Numpy-discussion] Raveling, reshape order keyword unnecessarily confuses index and memory ordering

2013-04-01 Thread Sebastian Berg
On Sun, 2013-03-31 at 14:04 -0700, Matthew Brett wrote: Hi, On Sun, Mar 31, 2013 at 1:43 PM, josef.p...@gmail.com wrote: On Sun, Mar 31, 2013 at 3:54 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sat, Mar 30, 2013 at 10:38 PM, josef.p...@gmail.com wrote: On Sun, Mar

Re: [Numpy-discussion] Raveling, reshape order keyword unnecessarily confuses index and memory ordering

2013-03-30 Thread Sebastian Berg
On Fri, 2013-03-29 at 19:08 -0700, Matthew Brett wrote: Hi, We were teaching today, and found ourselves getting very confused about ravel and shape in numpy. Summary -- There are two separate ideas needed to understand ordering in ravel and reshape: Idea 1): ravel /

Re: [Numpy-discussion] Raveling, reshape order keyword unnecessarily confuses index and memory ordering

2013-03-30 Thread Sebastian Berg
On Sat, 2013-03-30 at 12:45 -0700, Matthew Brett wrote: Hi, On Sat, Mar 30, 2013 at 11:55 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Fri, 2013-03-29 at 19:08 -0700, Matthew Brett wrote: Hi, We were teaching today, and found ourselves getting very confused about ravel

Re: [Numpy-discussion] NumPy/SciPy participation in GSoC 2013

2013-03-24 Thread Sebastian Berg
On Thu, 2013-03-21 at 22:20 +0100, Ralf Gommers wrote: Hi all, It is the time of the year for Google Summer of Code applications. If we want to participate with Numpy and/or Scipy, we need two things: enough mentors and ideas for projects. If we get those, we'll apply under the PSF

[Numpy-discussion] Compile time flag for numpy

2013-03-09 Thread Sebastian Berg
Hey, how would I go about making a compile time flag for numpy to use as a macro? The reason is: https://github.com/numpy/numpy/pull/2735 so that it would be possible to compile numpy differently for debugging if software depending on numpy is broken by this change. Regards, Sebastian

Re: [Numpy-discussion] Compile time flag for numpy

2013-03-09 Thread Sebastian Berg
On Sat, 2013-03-09 at 17:17 +0100, Sebastian Berg wrote: Hey, how would I go about making a compile time flag for numpy to use as a macro? To be clear I mean an environment variable. The reason is: https://github.com/numpy/numpy/pull/2735 so that it would be possible to compile numpy

Re: [Numpy-discussion] aligned / unaligned structured dtype behavior (was: GSOC 2013)

2013-03-06 Thread Sebastian Berg
On Wed, 2013-03-06 at 12:42 -0600, Kurt Smith wrote: On Wed, Mar 6, 2013 at 12:12 PM, Kurt Smith kwmsm...@gmail.com wrote: On Wed, Mar 6, 2013 at 4:29 AM, Francesc Alted franc...@continuum.io wrote: I would not run too much. The example above takes 9 bytes to host the structure, while

<    1   2   3   4   5   >