Re: [Numpy-discussion] np.dot and 'out' bug

2013-05-23 Thread Nathaniel Smith
On Thu, May 23, 2013 at 3:57 PM, Matthieu Brucher matthieu.bruc...@gmail.com wrote: In my point of view, you should never use an output argument equal to an input argument. It can impede a lot of optimizations. This is a fine philosophy in some cases, but a non-starter in others. Python doesn't

Re: [Numpy-discussion] Equvalent function for Ceil() and Floor()

2013-05-20 Thread Nathaniel Smith
On Mon, May 20, 2013 at 4:21 PM, Bakhtiyor Zokhidov bakhtiyor_zokhi...@mail.ru wrote: Hello, I am using ceil() and floor() function to get upper and lower value of some numbers. Let's say: import math x1 = 0.35 y1 = 4.46 math.ceil(x1) 1.0 math.floor(y1) 4.0 The problem is that If I

Re: [Numpy-discussion] 0-dim arrays inconsistency

2013-05-10 Thread Nathaniel Smith
Hi Neal, On Fri, May 10, 2013 at 7:36 PM, Neal Becker ndbeck...@gmail.com wrote: np.array ((0,0)) Out[10]: array([0, 0]) ok, it's 2 dimensional Think you may have confused yourself :-). It's 1 dimensional with 2 elements... In [11]: np.array ((0,0)).shape Out[11]: (2,) except, it isn't

Re: [Numpy-discussion] searchsorted descending arrays

2013-05-06 Thread Nathaniel Smith
On Mon, May 6, 2013 at 6:54 PM, Bago mrb...@gmail.com wrote: I submitted a patch a little while ago, https://github.com/numpy/numpy/pull/3107, which gave the searchsorted function the ability to search arrays sorted in descending order. At the time my approach was to detect the sortorder of

Re: [Numpy-discussion] Profiling (was GSoC : Performance parity between numpy arrays and Python scalars)

2013-05-05 Thread Nathaniel Smith
On Sun, May 5, 2013 at 5:57 PM, David Cournapeau courn...@gmail.com wrote: perf is a fabulous framework and doesn't have any way to get full callgraph information out so IME it's been useless. They have reporting modes that claim to (like some fractal thing?) but AFAI been able to tell from

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

2013-05-02 Thread Nathaniel Smith
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() np.minmax() np.argminmax() Vague Consensus: np.sincos() If the

Re: [Numpy-discussion] Profiling (was GSoC : Performance parity between numpy arrays and Python scalars)

2013-05-02 Thread Nathaniel Smith
On Thu, May 2, 2013 at 9:25 AM, David Cournapeau courn...@gmail.com wrote: * Re: the profiling, I wrote a full oprofile-callgrind format script years ago: http://vorpus.org/~njs/op2calltree.py Haven't used it in years either but neither oprofile nor kcachegrind are terribly fast-moving

Re: [Numpy-discussion] Profiling (was GSoC : Performance parity between numpy arrays and Python scalars)

2013-05-02 Thread Nathaniel Smith
On Thu, May 2, 2013 at 10:51 AM, Francesc Alted franc...@continuum.io wrote: On 5/2/13 3:58 PM, Nathaniel Smith wrote: callgrind has the *fabulous* kcachegrind front-end, but it only measures memory access performance on a simulated machine, which is very useful sometimes (if you're trying

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

2013-05-01 Thread Nathaniel Smith
On 1 May 2013 08:49, Yaroslav Halchenko li...@onerussian.com wrote: Thanks everyone for the feedback. Is it worth me starting a bisection to catch where it was introduced? Is it a bug, or just typical fp rounding issues? Do we know which answer is correct? -n

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

2013-05-01 Thread Nathaniel Smith
On Wed, May 1, 2013 at 9:12 AM, Pauli Virtanen p...@iki.fi wrote: 01.05.2013 16:01, Yaroslav Halchenko kirjoitti: [clip] to ignorant me, even without considering 'correctness', it is just a typical regression -- results changed from one release to another (and not to the better side). To me

Re: [Numpy-discussion] GSoC proposal -- Numpy SciPy

2013-04-30 Thread Nathaniel Smith
On Tue, Apr 30, 2013 at 3:19 PM, Blake Griffith blake.a.griff...@gmail.com wrote: Hello, I'm writing a GSoC proposal, mostly concerning SciPy, but it involves a few changes to NumPy. The proposal is titled: Improvements to the sparse package of Scipy: support for bool dtype and better

Re: [Numpy-discussion] GSoC proposal -- Numpy SciPy

2013-04-30 Thread Nathaniel Smith
On Tue, Apr 30, 2013 at 4:02 PM, Pauli Virtanen p...@iki.fi wrote: 30.04.2013 22:37, Nathaniel Smith kirjoitti: [clip] How do you plan to go about this? The obvious option of just calling scipy.sparse.issparse() on ufunc entry raises some problems, since numpy can't depend on or even import

Re: [Numpy-discussion] ANN: NumPy 1.7.1 release

2013-04-19 Thread Nathaniel Smith
On Fri, Apr 19, 2013 at 4:17 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Fri, Apr 19, 2013 at 8:12 AM, Ondřej Čertík ondrej.cer...@gmail.com wrote: I'm pleased to announce the availability of the final NumPy 1.7.1 release. Nice work -- but darn! I was hoping a change/fix

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

2013-04-19 Thread Nathaniel Smith
On 19 Apr 2013 19:22, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Anyway -- going to HDF, or netcdf, or role-your-own really seems like overkill for this. I just need something fast and simple and it doesn't need to interchange with anything else. Just use pickle...? -n

Re: [Numpy-discussion] MapIter api

2013-04-16 Thread Nathaniel Smith
On Mon, Apr 15, 2013 at 5:29 PM, 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 at least the mapiter struct, right? I got annoyed at all those special cases that make things difficult to

Re: [Numpy-discussion] The I dtype character

2013-04-12 Thread Nathaniel Smith
On Mon, Apr 8, 2013 at 8:14 AM, Georg Brandl g.bra...@gmx.net wrote: Hi, is it intentional that I is supported as a dtype character, but cannot be suffixed with a size? dtype('i1') dtype('int8') dtype('I1') dtype('uint32') i means integer. i1 means integer with 8 bits. I means 32-bit

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

2013-04-11 Thread Nathaniel Smith
On Thu, Apr 11, 2013 at 11:32 AM, Sebastian Berg sebast...@sipsolutions.net wrote: 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

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

2013-04-11 Thread Nathaniel Smith
On 11 Apr 2013 15:29, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 11, 2013 at 4:32 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Wed, 2013-03-06 at 11:43 -0700, Charles R Harris wrote: Hi All, snip The development branch has been accumulating stuff since

Re: [Numpy-discussion] OpenOpt Suite release 0.45

2013-04-10 Thread Nathaniel Smith
On 10 Apr 2013 08:01, Dmitrey tm...@ukr.net wrote: --- Исходное сообщение --- От кого: Robert Kern robert.k...@gmail.com Дата: 9 апреля 2013, 14:29:43 On Tue, Apr 9, 2013 at 4:15 PM, Dmitrey tm...@ukr.net wrote: --- Исходное сообщение --- От кого: Robert Kern robert.k...@gmail.com

Re: [Numpy-discussion] OpenOpt Suite release 0.45

2013-04-10 Thread Nathaniel Smith
An easy solution to all of this is to use a dict-like object that matches keys based on object identity while ignoring __hash__ and __eq__ entirely, e.g.: https://bitbucket.org/pypy/pypy/src/2f51f2142f7b/lib_pypy/identity_dict.py#cl-9 -n On Wed, Apr 10, 2013 at 10:45 AM, Sebastian Berg

Re: [Numpy-discussion] question about the data entry in the __array_interface__

2013-04-07 Thread Nathaniel Smith
On Sun, Apr 7, 2013 at 2:26 PM, Valentin Haenel valen...@haenel.co wrote: I know that the address is contained in the 'data' field of the '__array_interface__' and is either an int or a long. My guess is that this depends on the architecture of the system, i.e. 32 vs 64 bit systems. My

Re: [Numpy-discussion] Sources more confusing in Python

2013-04-07 Thread Nathaniel Smith
On Sun, Apr 7, 2013 at 10:25 PM, Steve Waterbury water...@pangalactic.us wrote: On 04/07/2013 05:02 PM, Chris Barker - NOAA Federal wrote: On Sun, Apr 7, 2013 at 8:06 AM, Daπid davidmen...@gmail.com wrote: On 7 April 2013 16:53, Happyman bahtiyor_zohi...@mail.ru wrote: $pip install numpy # to

Re: [Numpy-discussion] Sources more confusing in Python

2013-04-07 Thread Nathaniel Smith
On Sun, Apr 7, 2013 at 10:49 PM, Olivier Delalleau sh...@keba.be wrote: 2013/4/7 josef.p...@gmail.com On Sun, Apr 7, 2013 at 5:34 PM, Steve Waterbury water...@pangalactic.us wrote: On 04/07/2013 05:30 PM, Nathaniel Smith wrote: On Sun, Apr 7, 2013 at 10:25 PM, Steve Waterbury water

Re: [Numpy-discussion] Fwd: Pull request #3188 - Void scalar pickling behavior.

2013-04-06 Thread Nathaniel Smith
On Sat, Apr 6, 2013 at 8:03 PM, Alex Ford for...@uw.edu wrote: Hello, Do any core developers or uses have guidance on how to resolve PR #3188 (https://github.com/numpy/numpy/pull/3188) in relation to the pickling behavior of array scalar objects? To summarize, pickling array scalars with

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Nathaniel Smith
On Thu, Apr 4, 2013 at 12:52 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Thanks all for taking an interest. I need to think a bot more about the options before commenting more, but: while we're at it: It seems very odd to me that datetime64 supports different units (right

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Nathaniel Smith
On Thu, Apr 4, 2013 at 6:06 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 4, 2013 at 11:01 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Wed, Apr 3, 2013 at 6:02 PM, Mark Wiebe mwwi...@gmail.com wrote: One problem with trying to give technically

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Nathaniel Smith
On Wed, Apr 3, 2013 at 2:26 PM, Dave Hirschfeld dave.hirschf...@gmail.com wrote: Andreas Hilboll lists at hilboll.de writes: I think your point about using current timezone in interpreting user input being dangerous is probably correct --- perhaps UTC all the way would be a safer (and

Re: [Numpy-discussion] Please stop bottom posting!!

2013-04-03 Thread Nathaniel Smith
On Wed, Apr 3, 2013 at 11:00 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Best of all is intelligent editing of the thread so far -- edit it down to the key points you are commenting on, and intersperse your comments. That way your email stands on its own as meaningful, but

Re: [Numpy-discussion] Indexing bug

2013-04-02 Thread Nathaniel Smith
On Sun, Mar 31, 2013 at 6:14 AM, Ivan Oseledets ivan.oseled...@gmail.com wrote: I am using numpy 1.6.1, and encountered a wierd fancy indexing bug: import numpy as np c = np.random.randn(10,200,10); In [29]: print c[[0,1],:200,:2].shape (2, 200, 2) In [30]: print

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

2013-04-02 Thread Nathaniel Smith
On Sat, Mar 30, 2013 at 2:08 AM, Matthew Brett matthew.br...@gmail.com 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:

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

2013-04-02 Thread Nathaniel Smith
On Tue, Apr 2, 2013 at 6:59 PM, Matthew Brett matthew.br...@gmail.com wrote: On Tue, Apr 2, 2013 at 7:32 AM, Nathaniel Smith n...@pobox.com wrote: Maybe we should go through and rename order to something more descriptive in each case, so we'd have a.reshape(..., index_order=C) a.copy

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

2013-04-02 Thread Nathaniel Smith
On Tue, Apr 2, 2013 at 8:10 PM, Todd toddr...@gmail.com wrote: On Tue, Apr 2, 2013 at 8:12 PM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Mon, Apr 1, 2013 at 2:27 PM, Todd toddr...@gmail.com wrote: There were a number of other ideas in this thread:

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

2013-04-02 Thread Nathaniel Smith
On Tue, Apr 2, 2013 at 10:21 PM, Matthew Brett matthew.br...@gmail.com wrote: This is like observing that if I say go North then it's ambiguous about whether I want you to drive or walk, and concluding that we need new words for the directions depending on what sort of vehicle you use. So go

Re: [Numpy-discussion] Implementing a find first style function

2013-03-27 Thread Nathaniel Smith
On Tue, Mar 26, 2013 at 9:20 AM, Phil Elson pelson@gmail.com wrote: Bump. I'd be interested to know if this is a desirable feature for numpy? (specifically the 1D find functionality rather than the any/all also discussed) If so, I'd be more than happy to submit a PR, but I don't want to

Re: [Numpy-discussion] Growing the contributor base of Numpy

2013-03-27 Thread Nathaniel Smith
On Wed, Mar 27, 2013 at 2:41 PM, Andrea Cimatoribus andrea.cimatori...@nioz.nl wrote: Not sure if this is really relevant to the original message, but here is my opinion. I think that the numpy/scipy community would greatly benefit from a platform enabling easy sharing of code written by

Re: [Numpy-discussion] howto apply-along-axis?

2013-03-22 Thread Nathaniel Smith
On 22 Mar 2013 14:09, Neal Becker ndbeck...@gmail.com wrote: I frequently find I have my 1d function that performs some reduction that I'd like to apply-along some axis of an n-d array. As a trivial example, def sum(u): return np.sum (u) In this case the function is probably C/C++

Re: [Numpy-discussion] Add ability to disable the autogeneration of the function signature in a ufunc docstring.

2013-03-20 Thread Nathaniel Smith
On 20 Mar 2013 17:11, Warren Weckesser warren.weckes...@gmail.com wrote: On Fri, Mar 15, 2013 at 4:39 PM, Nathaniel Smith n...@pobox.com wrote: On Fri, Mar 15, 2013 at 6:47 PM, Warren Weckesser warren.weckes...@gmail.com wrote: Hi all, In a recent scipy pull request (https

Re: [Numpy-discussion] OpenOpt Suite release 0.45

2013-03-16 Thread Nathaniel Smith
On 16 Mar 2013 11:49, Dmitrey tm...@ukr.net wrote: --- Исходное сообщение --- От кого: Matthieu Brucher matthieu.bruc...@gmail.com Дата: 16 марта 2013, 12:39:07 Even if they have different hashes, they can be stored in the same underlying list before they are retrieved. Then, an actual

Re: [Numpy-discussion] indexing of arbitrary axis and arbitrary slice?

2013-03-16 Thread Nathaniel Smith
On 16 Mar 2013 16:41, Chao YUE chaoyue...@gmail.com wrote: Dear all, Is there some way to index the numpy array by specifying arbitrary axis and arbitrary slice, while not knowing the actual shape of the data? For example, I have a 3-dim data, data.shape = (3,4,5) Is there a way to retrieve

Re: [Numpy-discussion] Add ability to disable the autogeneration of the function signature in a ufunc docstring.

2013-03-16 Thread Nathaniel Smith
On Fri, Mar 15, 2013 at 9:19 PM, Pauli Virtanen p...@iki.fi wrote: 15.03.2013 22:39, Nathaniel Smith kirjoitti: [clip] - Something else... How about: scrap the automatic signatures altogether, and directly use the docstring provided to the ufunc creation function? I suspect ufuncs

Re: [Numpy-discussion] Possible bug in numpy 1.6.1

2013-03-15 Thread Nathaniel Smith
That does look unlikely yeah... Does this have any consequences that you've found? Is there a test case that fails before the patch but works after? -n On 15 Mar 2013 09:19, Ake Sandgren ake.sandg...@hpc2n.umu.se wrote: Hi! Found this thing that looks like a bug in

Re: [Numpy-discussion] OpenOpt Suite release 0.45

2013-03-15 Thread Nathaniel Smith
On Fri, Mar 15, 2013 at 7:34 PM, Dmitrey tm...@ukr.net wrote: --- Исходное сообщение --- От кого: Alan G Isaac alan.is...@gmail.com Дата: 15 марта 2013, 20:38:38 On 3/15/2013 9:21 AM, Dmitrey wrote: Temporary walkaround for a serious bug in FuncDesigner automatic differentiation kernel due

Re: [Numpy-discussion] Possible bug in numpy 1.6.1

2013-03-15 Thread Nathaniel Smith
On Fri, Mar 15, 2013 at 9:52 AM, Ake Sandgren ake.sandg...@hpc2n.umu.se wrote: On Fri, 2013-03-15 at 09:44 +, Nathaniel Smith wrote: That does look unlikely yeah... Does this have any consequences that you've found? Is there a test case that fails before the patch but works after

Re: [Numpy-discussion] Add ability to disable the autogeneration of the function signature in a ufunc docstring.

2013-03-15 Thread Nathaniel Smith
On Fri, Mar 15, 2013 at 6:47 PM, Warren Weckesser warren.weckes...@gmail.com wrote: Hi all, In a recent scipy pull request (https://github.com/scipy/scipy/pull/459), I ran into the problem of ufuncs automatically generating a signature in the docstring using arguments such as 'x' or 'x1, x2'.

Re: [Numpy-discussion] fast numpy.fromfile skipping data chunks

2013-03-13 Thread Nathaniel Smith
On Wed, Mar 13, 2013 at 1:45 PM, Andrea Cimatoribus andrea.cimatori...@nioz.nl wrote: Hi everybody, I hope this has not been discussed before, I couldn't find a solution elsewhere. I need to read some binary data, and I am using numpy.fromfile to do this. Since the files are huge, and would

Re: [Numpy-discussion] R: fast numpy.fromfile skipping data chunks

2013-03-13 Thread Nathaniel Smith
On Wed, Mar 13, 2013 at 2:18 PM, Andrea Cimatoribus andrea.cimatori...@nioz.nl wrote: This solution does not work for me since I have an offset before the data that is not a multiple of the datatype (it's a header containing various stuff). np.memmap takes an offset= argument. -n

Re: [Numpy-discussion] R: R: R: fast numpy.fromfile skipping data chunks

2013-03-13 Thread Nathaniel Smith
On Wed, Mar 13, 2013 at 2:46 PM, Andrea Cimatoribus andrea.cimatori...@nioz.nl wrote: Indeed, but that offset it should be a multiple of the byte-size of dtype as the help says. My mistake, sorry, even if the help says so, it seems that this is not the case in the actual code. Still, the

Re: [Numpy-discussion] R: R: R: R: fast numpy.fromfile skipping data chunks

2013-03-13 Thread Nathaniel Smith
On 13 Mar 2013 15:16, Andrea Cimatoribus andrea.cimatori...@nioz.nl wrote: Ok, this seems to be working (well, as soon as I get the right offset and things like that, but that's a different story). The problem is that it does not go any faster than my initial function compiled with cython, and

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-12 Thread Nathaniel Smith
On Mon, Mar 11, 2013 at 9:46 AM, Robert Kern robert.k...@gmail.com wrote: On Sun, Mar 10, 2013 at 6:12 PM, Siu Kwan Lam s...@continuum.io wrote: My suggestion to overcome (1) and (2) is to allow the user to select between the two implementations (and possibly different algorithms in the

Re: [Numpy-discussion] Adopt Mersenne Twister 64bit?

2013-03-12 Thread Nathaniel Smith
On Tue, Mar 12, 2013 at 9:25 PM, Nathaniel Smith n...@pobox.com wrote: On Mon, Mar 11, 2013 at 9:46 AM, Robert Kern robert.k...@gmail.com wrote: On Sun, Mar 10, 2013 at 6:12 PM, Siu Kwan Lam s...@continuum.io wrote: My suggestion to overcome (1) and (2) is to allow the user to select between

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

2013-03-08 Thread Nathaniel Smith
On Fri, Mar 8, 2013 at 11:07 AM, Ondřej Čertík ondrej.cer...@gmail.com wrote: I hope to finish the rest of issues for 1.7.1 today or tomorrow. Should I release 1.7.1rc1 first? I think that makes sense, just to be sure, right? Big +1 to doing an RC from me. I guess conceptually this is like we

Re: [Numpy-discussion] Definition of dot function

2013-03-07 Thread Nathaniel Smith
On 7 Mar 2013 20:27, Henry Gomersall h...@cantab.net wrote: On Thu, 2013-03-07 at 13:36 -0600, Mayank Daga wrote: Can someone point me to the definition of dot() in the numpy source? The only instance of 'def dot()' I found was in numpy/ma/extras.py but that does not seem to be the correct

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

2013-03-06 Thread Nathaniel Smith
On Wed, Mar 6, 2013 at 6:43 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, There are now some 14 non-merge commits in the 1.7.x branch including the critical diagonal leak fix. I think there is maybe one more critical backport and perhaps several low priority fixes,

[Numpy-discussion] Numpy deprecation schedule

2013-03-06 Thread Nathaniel Smith
A number of items on the 1.8 todo list are reminders to remove things that we deprecated in 1.7, and said we would remove in 1.8, e.g.: https://github.com/numpy/numpy/issues/596 https://github.com/numpy/numpy/issues/294 But, since 1.8 is so soon after 1.7, we probably shouldn't actually do

Re: [Numpy-discussion] Numpy deprecation schedule

2013-03-06 Thread Nathaniel Smith
On Wed, Mar 6, 2013 at 9:24 PM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Wed, Mar 6, 2013 at 9:38 PM, Nathaniel Smith n...@pobox.com wrote: On Wed, Mar 6, 2013 at 8:21 PM, Frédéric Bastien no...@nouiz.org wrote: That sound good. To be sure, the now mean the first release that include

Re: [Numpy-discussion] Numpy deprecation schedule

2013-03-06 Thread Nathaniel Smith
On Wed, Mar 6, 2013 at 10:33 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 6, 2013 at 8:09 PM, Nathaniel Smith n...@pobox.com wrote: A number of items on the 1.8 todo list are reminders to remove things that we deprecated in 1.7, and said we would remove in 1.8, e.g.: https

Re: [Numpy-discussion] Numpy deprecation schedule

2013-03-06 Thread Nathaniel Smith
On Wed, Mar 6, 2013 at 10:53 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 6, 2013 at 10:45 PM, Nathaniel Smith n...@pobox.com wrote: On Wed, Mar 6, 2013 at 10:33 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Mar 6, 2013 at 8:09 PM, Nathaniel Smith n...@pobox.com wrote

Re: [Numpy-discussion] GSOC 2013

2013-03-05 Thread Nathaniel Smith
On 4 Mar 2013 23:21, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Mon, Mar 4, 2013 at 2:29 PM, Todd toddr...@gmail.com wrote: 5. Currently dtypes are limited to a set of fixed types, or combinations of these types. You can't have, say, a 48 bit float or a 1-bit bool. This project

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Nathaniel Smith
On Fri, Mar 1, 2013 at 12:33 PM, Henry Gomersall h...@cantab.net wrote: On Fri, 2013-03-01 at 13:25 +0100, Sebastian Berg wrote: there has been a request on the issue tracker for a step parameter to linspace. This is of course tricky with the imprecision of floating point numbers. How is

Re: [Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-26 Thread Nathaniel Smith
On Tue, Feb 26, 2013 at 10:21 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Mon, 2013-02-25 at 16:33 +, Nathaniel Smith wrote: On Mon, Feb 25, 2013 at 3:10 PM, Sebastian Berg sebast...@sipsolutions.net wrote: Hello all, currently the `__contains__` method

Re: [Numpy-discussion] 1.7.1

2013-02-26 Thread Nathaniel Smith
On Tue, Feb 26, 2013 at 9:21 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Feb 26, 2013 at 2:03 PM, Ralf Gommers ralf.gomm...@gmail.com wrote: On Tue, Feb 26, 2013 at 7:47 PM, Charles R Harris charlesr.har...@gmail.com wrote: When should we put out 1.7.1? Discuss ;)

Re: [Numpy-discussion] What should np.ndarray.__contains__ do

2013-02-25 Thread Nathaniel Smith
On Mon, Feb 25, 2013 at 3:10 PM, Sebastian Berg sebast...@sipsolutions.net wrote: Hello all, currently the `__contains__` method or the `in` operator on arrays, does not return what the user would expect when in the operation `a in b` the `a` is not a single element (see In [3]-[4] below).

Re: [Numpy-discussion] Leaking memory problem

2013-02-25 Thread Nathaniel Smith
Is this with 1.7? There see a few memory leak fixes in 1.7, so if you aren't using that you should try it to be sure. And if you are using it, then there is one known memory leak bug in 1.7 that you might want to check whether you're hitting: https://github.com/numpy/numpy/issues/2969 -n On 25

Re: [Numpy-discussion] Smart way to do this?

2013-02-23 Thread Nathaniel Smith
On Sat, Feb 23, 2013 at 4:51 PM, Jose Amoreira ljmamore...@gmail.com wrote: On Saturday, February 23, 2013 00:45:55 Brett Olsen wrote: a = np.ones(30) idx = np.array([2, 3, 2]) a += 2 * np.bincount(idx, minlength=len(a)) a array([ 1., 1., 5., 3., 1., 1., 1., 1., 1., 1., 1., 1., 1.,

Re: [Numpy-discussion] Adding .abs() method to the array object

2013-02-23 Thread Nathaniel Smith
On Sat, Feb 23, 2013 at 3:38 PM, Till Stensitzki mail.t...@gmx.de wrote: Hello, i know that the array object is already crowded, but i would like to see the abs method added, especially doing work on the console. Considering that many much less used functions are also implemented as a method,

Re: [Numpy-discussion] calling NumPy from Julia - a plea for fewer macros

2013-02-17 Thread Nathaniel Smith
On 17 Feb 2013 08:13, Steven G. Johnson wrote: Julia has the ability to call C functions directly (without writing C glue), and I've been exploiting this to write PyCall purely in Julia. (This is nice for a number of reasons; besides programming and linking convenience, it means that I can

Re: [Numpy-discussion] Any plans for windows 64-bit installer for 1.7?

2013-02-04 Thread Nathaniel Smith
On Mon, Feb 4, 2013 at 12:36 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Mon, Feb 4, 2013 at 12:27 PM, Ondřej Čertík ondrej.cer...@gmail.com wrote: On Sun, Feb 3, 2013 at 2:57 AM, David Cournapeau courn...@gmail.com wrote: On Sun, Feb 3, 2013 at 12:28 AM, josef.p...@gmail.com

Re: [Numpy-discussion] pull request: generalized ufunc signature fix and lineal algebra generalized ufuncs

2013-01-31 Thread Nathaniel Smith
On Thu, Jan 31, 2013 at 8:43 AM, Oscar Villellas oscar.villel...@continuum.io wrote: Hello, At Continuum Analytics we've been working on a submodule implementing a set of lineal algebra operations as generalized ufuncs. This allows specifying arrays of lineal algebra problems to be computed

Re: [Numpy-discussion] Shouldn't all in-place operations simply return self?

2013-01-17 Thread Nathaniel Smith
On Thu, Jan 17, 2013 at 2:32 PM, Alan G Isaac alan.is...@gmail.com wrote: Is it really better to have `permute` and `permuted` than to add a keyword? (Note that these are actually still ambiguous, except by convention.) The convention in question, though, is that of English grammar. In

Re: [Numpy-discussion] Shouldn't all in-place operations simply return self?

2013-01-17 Thread Nathaniel Smith
On Thu, Jan 17, 2013 at 6:08 PM, Dag Sverre Seljebotn d.s.seljeb...@astro.uio.no wrote: In addition to the verb tense, I think it's important that mutators are methods whereas functions do not mutate their arguments: lst.sort() sorted(lst) Unfortunately this isn't really viable in a

Re: [Numpy-discussion] Casting Bug or a Feature?

2013-01-16 Thread Nathaniel Smith
This is separate from the scalar casting thing. This is a disguised version of the discussion about what we should do with implicit casts caused by assignment: into_array[i] = 0.5 Traditionally numpy just happily casts this stuff, possibly mangling data in the process, and this has caused many

Re: [Numpy-discussion] Shouldn't all in-place operations simply return self?

2013-01-16 Thread Nathaniel Smith
On 16 Jan 2013 17:54, josef.p...@gmail.com wrote: a = np.random.random_integers(0, 5, size=5) b = a.sort() b a array([0, 1, 2, 5, 5]) b = np.random.shuffle(a) b b = np.random.permutation(a) b array([0, 5, 5, 2, 1]) How do I remember if shuffle shuffles or permutes ? Do we

Re: [Numpy-discussion] 1.8 release

2013-01-14 Thread Nathaniel Smith
On Mon, Jan 14, 2013 at 4:45 PM, Frédéric Bastien no...@nouiz.org wrote: I don't volontear for the next release manager, but +1 for shorter releases. I heard just good comments from that. Also, I'm not sure it would ask more from the release manager. Do someone have an idea? The most work I do

Re: [Numpy-discussion] How many build systems do we need?

2013-01-13 Thread Nathaniel Smith
On Sun, Jan 13, 2013 at 5:34 AM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, In the continuing proposal for cleanups, note that we currently support three (3!) build systems, distutils, scons, and bento. That's a bit much to maintain when contemplating changes, and scons and

Re: [Numpy-discussion] How many build systems do we need?

2013-01-13 Thread Nathaniel Smith
On Sun, Jan 13, 2013 at 3:47 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Jan 13, 2013 at 7:30 AM, Nathaniel Smith n...@pobox.com wrote: On Sun, Jan 13, 2013 at 5:34 AM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, In the continuing proposal for cleanups

Re: [Numpy-discussion] 1.8 release

2013-01-13 Thread Nathaniel Smith
On Sun, Jan 13, 2013 at 7:03 PM, Charles R Harris charlesr.har...@gmail.com wrote: Now that 1.7 is nearing release, it's time to look forward to the 1.8 release. I'd like us to get back to the twice yearly schedule that we tried to maintain through the 1.3 - 1.6 releases, so I propose a June

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-13 Thread Nathaniel Smith
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com wrote: On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote: Hi all, PR 2875 adds two new functions, that generalize zeros(), ones(), zeros_like(), ones_like(), by simply taking an arbitrary fill value

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-13 Thread Nathaniel Smith
On Sun, Jan 13, 2013 at 11:48 PM, Skipper Seabold jsseab...@gmail.com wrote: On Sun, Jan 13, 2013 at 6:39 PM, Nathaniel Smith n...@pobox.com wrote: On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com wrote: On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote

Re: [Numpy-discussion] return index of maximum value in an array easily?

2013-01-11 Thread Nathaniel Smith
On Thu, Jan 10, 2013 at 9:40 AM, Chao YUE chaoyue...@gmail.com wrote: Dear all, Are we going to consider returning the index of maximum value in an array easily without calling np.argmax and np.unravel_index consecutively? This does seem like a good thing to support somehow. What would a

Re: [Numpy-discussion] Bug with ufuncs made with frompyfunc

2013-01-09 Thread Nathaniel Smith
On Wed, Jan 9, 2013 at 7:23 AM, OKB (not okblacke) brenb...@brenbarn.net wrote: A bug causing errors with using methods of ufuncs created with frompyfunc was mentioned on the list over a year ago: http://mail.scipy.org/pipermail/numpy-discussion/2011- September/058501.html Is

Re: [Numpy-discussion] Insights / lessons learned from NumPy design

2013-01-09 Thread Nathaniel Smith
On Wed, Jan 9, 2013 at 2:53 PM, Alan G Isaac alan.is...@gmail.com wrote: I'm just a Python+NumPy user and not a CS type. May I ask a naive question on this thread? Given the work that has (as I understand it) gone into making NumPy usable as a C library, why is the discussion not going in a

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-09 Thread Nathaniel Smith
On Tue, Jan 8, 2013 at 9:14 PM, Andrew Collette andrew.colle...@gmail.com wrote: Hi Nathaniel, (Responding to both your emails) The problem is that rule for arrays - and for every other party of numpy in general - are that we *don't* pick types based on values. Numpy always uses input types

Re: [Numpy-discussion] Remove support for numeric and numarray in 1.8

2013-01-09 Thread Nathaniel Smith
On Wed, Jan 9, 2013 at 11:21 PM, Christopher Hanley chan...@gmail.com wrote: After poking around our code base and talking to a few folks I predict that we at STScI can remove our dependence on the numpy-numarray compatibility layer by the end of this calendar year. I'm unsure of what the

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-08 Thread Nathaniel Smith
On 8 Jan 2013 17:24, Andrew Collette andrew.colle...@gmail.com wrote: Hi, I think you are voting strongly for the current casting rules, because they make it less obvious to the user that scalars are different from arrays. Maybe this is the source of my confusion... why should scalars

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-08 Thread Nathaniel Smith
On Tue, Jan 8, 2013 at 7:28 PM, Alan G Isaac alan.is...@gmail.com wrote: On 1/8/2013 1:48 PM, Olivier Delalleau wrote: As I mentioned in another post, I also agree that it would make things simpler and safer to just yield the same result as if we were using a one-element array. Yes!

Re: [Numpy-discussion] Linear least squares

2013-01-08 Thread Nathaniel Smith
On Tue, Jan 8, 2013 at 6:17 PM, Till Stensitz mail.t...@gmx.de wrote: Hi, i did some profiling and testing of my data-fitting code. One of its core parts is doing some linear least squares, until now i used np.linalg.lstsq. Most of time the size a is (250, 7) and of b is (250, 800). Today i

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-07 Thread Nathaniel Smith
On Mon, Jan 7, 2013 at 2:17 AM, Olivier Delalleau sh...@keba.be wrote: Hehe, I didn't even know there was supposed to be a warning for arrays... Ok. But I'm not convinced that re-using the overflow category is a good idea, because to me the overflow is typically associated to the result of an

Re: [Numpy-discussion] Rank-0 arrays - reprise

2013-01-06 Thread Nathaniel Smith
On 6 Jan 2013 07:59, Dag Sverre Seljebotn d.s.seljeb...@astro.uio.no wrote: Try to enumerate all the fundamentally different things (if you count memory use/running time) that can happen for ndarrays a, b, and arbitrary x here: a += b[x] That's already quite a lot, your proposal adds even

Re: [Numpy-discussion] Remove support for numeric and numarray in 1.8

2013-01-06 Thread Nathaniel Smith
On Sun, Jan 6, 2013 at 2:38 AM, Charles R Harris charlesr.har...@gmail.com wrote: Thoughts? To be clear, what you're talking about is basically deleting these two packages: numpy.oldnumeric numpy.numarray plus the compatibility C API in numpy/numarray/include ? So this would only affect

Re: [Numpy-discussion] Rank-0 arrays - reprise

2013-01-06 Thread Nathaniel Smith
On Sun, Jan 6, 2013 at 10:35 AM, Dag Sverre Seljebotn d.s.seljeb...@astro.uio.no wrote: I should have been more precise: I like the proposal, but also believe the additional complexity introduced have significant costs that must be considered. a) Making += behave differently for readonly

Re: [Numpy-discussion] Remove support for numeric and numarray in 1.8

2013-01-06 Thread Nathaniel Smith
On Sun, Jan 6, 2013 at 10:36 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Jan 6, 2013 at 8:09 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Jan 6, 2013 at 7:42 AM, Nathaniel Smith n...@pobox.com wrote: On Sun, Jan 6, 2013 at 2:38 AM, Charles R Harris

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-06 Thread Nathaniel Smith
On Mon, Jan 7, 2013 at 1:43 AM, Olivier Delalleau sh...@keba.be wrote: 2013/1/5 Nathaniel Smith n...@pobox.com: On Fri, Jan 4, 2013 at 5:25 PM, Andrew Collette andrew.colle...@gmail.com wrote: I agree the current behavior is confusing. Regardless of the details of what to do, I suppose my

Re: [Numpy-discussion] Invalid value encoutered : how to prevent numpy.where to do this?

2013-01-05 Thread Nathaniel Smith
On Sat, Jan 5, 2013 at 2:15 PM, Eric Emsellem eric.emsel...@eso.org wrote: Dear all, I have a code using lots of numpy.where to make some constrained calculations as in: data = arange(10) result = np.where(data == 0, 0., 1./data) # or data1 = arange(10) data2 = arange(10)+1.0 result =

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-05 Thread Nathaniel Smith
On Sat, Jan 5, 2013 at 12:32 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Fri, Jan 4, 2013 at 4:54 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Fri, Jan 4, 2013 at 4:01 PM, Andrew Collette andrew.colle...@gmail.com wrote: From a more basic perspective, I think that

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-05 Thread Nathaniel Smith
On 5 Jan 2013 15:59, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sat, Jan 5, 2013 at 2:38 PM, Nathaniel Smith n...@pobox.com wrote: On Sat, Jan 5, 2013 at 12:32 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Fri, Jan 4, 2013 at 4:54 PM, Matthew Brett matthew.br

Re: [Numpy-discussion] Rank-0 arrays - reprise

2013-01-05 Thread Nathaniel Smith
On 5 Jan 2013 12:16, Matthew Brett matthew.br...@gmail.com wrote: Hi, Following on from Nathaniel's explorations of the scalar - array casting rules, some resources on rank-0 arrays. The discussion that Nathaniel tracked down on rank-0 arrays; it also makes reference to casting. The

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-05 Thread Nathaniel Smith
On Fri, Jan 4, 2013 at 5:25 PM, Andrew Collette andrew.colle...@gmail.com wrote: I agree the current behavior is confusing. Regardless of the details of what to do, I suppose my main objection is that, to me, it's really unexpected that adding a number to an array could result in an

Re: [Numpy-discussion] Invalid value encoutered : how to, prevent numpy.where to do this?

2013-01-05 Thread Nathaniel Smith
On Sat, Jan 5, 2013 at 10:07 PM, Eric Emsellem eric.emsel...@eso.org wrote: Thanks! This makes sense of course. And yes the operation I am trying to do is rather complicated so I need to rely on a prior selection. Now I would need to optimise this for large arrays and the code does go

Re: [Numpy-discussion] Rank-0 arrays - reprise

2013-01-05 Thread Nathaniel Smith
On Sat, Jan 5, 2013 at 10:10 PM, David Cournapeau courn...@gmail.com wrote: Thanks for the entertaining explanation. Procrastination is a hell of a drug. I don't think 0-dim array being slow is such a big drawback. I would be really surprised if there was no way to make them faster, and

Re: [Numpy-discussion] Scalar casting rules use-case reprise

2013-01-04 Thread Nathaniel Smith
On Fri, Jan 4, 2013 at 11:09 AM, Matthew Brett matthew.br...@gmail.com wrote: Hi, Reading the discussion on the scalar casting rule change I realized I was hazy on the use-cases that led to the rule that scalars cast differently from arrays. My impression was that the primary use-case was

<    4   5   6   7   8   9   10   11   12   13   >