Re: [Numpy-discussion] azip

2013-07-18 Thread Benjamin Root
wrote: > 18.07.2013 20:18, Benjamin Root kirjoitti: > > Forgive my ignorance, but has numpy and scipy stopped doing that weird > > doc editing thing that existed back in the days of Trac? I have actually > > held back on submitting doc edits because I hated using that thing so

Re: [Numpy-discussion] azip

2013-07-18 Thread Benjamin Root
Forgive my ignorance, but has numpy and scipy stopped doing that weird doc editing thing that existed back in the days of Trac? I have actually held back on submitting doc edits because I hated using that thing so much. ___ NumPy-Discussion mailing list N

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

2013-07-15 Thread Benjamin Root
3:47 -0600, Charles R Harris wrote: >> > On Mon, Jul 15, 2013 at 8:25 AM, Benjamin Root wrote: >> > >> > > This is going to need to be heavily documented with doctests. Also, >> just >> > > to clarify, are we talking about a ValueError for doi

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

2013-07-15 Thread Benjamin Root
On Jul 15, 2013 11:47 AM, "Charles R Harris" wrote: > > > On Mon, Jul 15, 2013 at 8:58 AM, Charles R Harris < > charlesr.har...@gmail.com> 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

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

2013-07-15 Thread Benjamin Root
This is going to need to be heavily documented with doctests. Also, just to clarify, are we talking about a ValueError for doing a nansum on an empty array as well, or will that now return a zero? Ben Root On Mon, Jul 15, 2013 at 9:52 AM, Charles R Harris wrote: > > > On Sun, Jul 14, 2013 at 3

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

2013-07-12 Thread Benjamin Root
I can see where you are getting at, but I would have to disagree. First of all, when a comparison between two mis-shaped arrays occur, you get back a bone fide python boolean, not a numpy array of bools. So if any action was taken on the result of such a comparison assumed that the result was some

Re: [Numpy-discussion] time to revisit NA/ma ideas

2013-06-15 Thread Benjamin Root
On Fri, Jun 14, 2013 at 6:38 PM, Eric Firing wrote: > A nice summary of the discussions from a year ago is here: > > http://www.numpy.org/NA-overview.html > > It provides food for thought. > > Eric > Perhaps a BoF session should be put together for SciPy 2013, and possibly even have a google han

Re: [Numpy-discussion] numpy.filled, again

2013-06-14 Thread Benjamin Root
On Fri, Jun 14, 2013 at 1:22 PM, Nathaniel Smith wrote: > On Wed, Jun 12, 2013 at 7:43 PM, Eric Firing wrote: > > On 2013/06/12 2:10 AM, Nathaniel Smith wrote: > >> Personally I think that overloading np.empty is horribly ugly, will > >> continue confusing newbies and everyone else indefinitely,

Re: [Numpy-discussion] numpy.filled, again

2013-06-14 Thread Benjamin Root
On Fri, Jun 14, 2013 at 1:21 PM, Robert Kern wrote: > On Fri, Jun 14, 2013 at 6:18 PM, Eric Firing wrote: > > On 2013/06/14 5:15 AM, Alan G Isaac wrote: > >> On 6/14/2013 9:27 AM, Aldcroft, Thomas wrote: > >>> If I just saw np.values(..) in some code I would never guess what it > is doing from t

Re: [Numpy-discussion] numpy.filled, again

2013-06-13 Thread Benjamin Root
On Thu, Jun 13, 2013 at 9:36 AM, Aldcroft, Thomas < aldcr...@head.cfa.harvard.edu> wrote: > > > > On Wed, Jun 12, 2013 at 2:55 PM, Eric Firing wrote: > >> On 2013/06/12 8:13 AM, Warren Weckesser wrote: >> > That's why I suggested 'filledwith' (add the underscore if you like). >> > This also allow

Re: [Numpy-discussion] floats coerced to string with "{:f}".format() ?

2013-06-06 Thread Benjamin Root
You can treat a record in a record array like a tuple or a dictionary when it comes to formatting. So, either refer to the index element you want formatted as a float, or refer to it by name (in the formatting language). By just doing {:f}, you are just grabbing the first one, which is "XXYYZZ" an

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-04 Thread Benjamin Root
Could non-monotonicity be detected as part of the interp process? Perhaps a sign switch in the deltas? I have been bitten by this problem too. Cheers! Ben Root On Jun 4, 2013 9:08 PM, "Eric Firing" wrote: > > On 2013/06/04 2:05 PM, Charles R Harris wrote: > > > > > > On Tue, Jun 4, 2013 at 12:0

Re: [Numpy-discussion] genfromtxt() skips comments

2013-05-31 Thread Benjamin Root
On Fri, May 31, 2013 at 5:08 PM, Albert Kottke wrote: > I noticed that genfromtxt() did not skip comments if the keyword names is > not True. If names is True, then genfromtxt() would take the first line as > the names. I am proposing a fix to genfromtxt that skips all of the > comments in a file,

Re: [Numpy-discussion] NumPy sprints at Scipy 2013, Austin: call for topics and hands to help

2013-05-25 Thread Benjamin Root
On Sat, May 25, 2013 at 12:37 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Sat, May 25, 2013 at 9:51 AM, David Cournapeau wrote: > >> On Sat, May 25, 2013 at 4:19 PM, Charles R Harris >> wrote: >> > >> > >> > On Sat, May 25, 2013 at 8:23 AM, David Cournapeau >> > wrote: >> >

Re: [Numpy-discussion] numpy.nanmin, numpy.nanmax, and scipy.stats.nanmean

2013-05-16 Thread Benjamin Root
On Thu, May 16, 2013 at 6:09 PM, Phillip Feldman < phillip.m.feld...@gmail.com> wrote: > It seems odd that `nanmin` and `nanmax` are in NumPy, while `nanmean` is > in SciPy.stats. I'd like to propose that a `nanmean` function be added to > NumPy. > > Have no fear. There is already plans for its

Re: [Numpy-discussion] searchsorted descending arrays

2013-05-07 Thread Benjamin Root
On Mon, May 6, 2013 at 7:16 PM, Nathaniel Smith wrote: > On Mon, May 6, 2013 at 6:54 PM, Bago 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

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

2013-05-01 Thread Benjamin Root
I have created a PR for the first two (and got np.nanvar() for free). https://github.com/numpy/numpy/pull/3297 Cheers! Ben Root ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

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

2013-05-01 Thread Benjamin Root
So, to summarize the thread so far: Consensus: np.nanmean() np.nanstd() np.minmax() np.argminmax() Vague Consensus: np.sincos() No Consensus (possibly out of scope for this topic): Better constructors for complex types I can probably whip up the PR for the nanmean() and nanstd(), and can certai

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

2013-05-01 Thread Benjamin Root
On Mon, Apr 29, 2013 at 2:10 PM, Andrew Giessel < andrew_gies...@hms.harvard.edu> wrote: > Matthew: Thanks for the link to array order discussion. > > Any more thoughts on Phil's slice() function? > > > I rather like Phil's solution. Just some caveats. Will it always return views or copies? It

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

2013-05-01 Thread Benjamin Root
On Wed, May 1, 2013 at 1:13 AM, Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: > > Of course, the documentation for discussed before: np.minmax(). My > thinking is that it would return a 2xN array > > How about a tuple: (min, max)? > > I am not familiar enough with numpy internals to

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

2013-04-30 Thread Benjamin Root
Currently, I am in the process of migrating some co-workers from Matlab and IDL, and the number one complaint I get is that numpy has nansum() but no nanmean() and nanstd(). While we do have an alternative in the form of masked arrays, most of these people are busy enough trying to port their exis

Re: [Numpy-discussion] 1.8 release

2013-04-29 Thread Benjamin Root
On Thu, Apr 25, 2013 at 11:16 AM, Charles R Harris < charlesr.har...@gmail.com> 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 t

Re: [Numpy-discussion] type conversion question

2013-04-18 Thread Benjamin Root
On Thu, Apr 18, 2013 at 7:31 PM, K.-Michael Aye wrote: > I don't understand why sometimes a direct assignment of a new dtype is > possible (but messes up the values), and why at other times a seemingly > harmless upcast (in my potentially ignorant point of view) is not > possible. > So, maybe a di

Re: [Numpy-discussion] datetime64 1970 issue

2013-04-18 Thread Benjamin Root
On Thu, Apr 18, 2013 at 2:27 AM, Joris Van den Bossche < jorisvandenboss...@gmail.com> wrote: > ANyone tested this on Windows? >> > > > On Windows 7, numpy 1.7.0 (Anaconda 1.4.0 64 bit), I don't even get a > wrong answer, but an error: > > In [3]: np.datetime64('1969-12-31 00') > Out[3]: numpy.dat

Re: [Numpy-discussion] datetime64 1970 issue

2013-04-17 Thread Benjamin Root
On Wed, Apr 17, 2013 at 7:10 PM, Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: > On Wed, Apr 17, 2013 at 1:09 PM, Bob Nnamtrop > wrote: > > It would seem that before 1970 the dates do not include the time zone > > adjustment while after 1970 they do. This is the source of the extra

Re: [Numpy-discussion] datetime64 1970 issue

2013-04-16 Thread Benjamin Root
On Tue, Apr 16, 2013 at 7:45 PM, Ondřej Čertík wrote: > On Tue, Apr 16, 2013 at 4:55 PM, Bob Nnamtrop > wrote: > > I am curious if others have noticed an issue with datetime64 at the > > beginning of 1970. First: > > > > In [144]: (np.datetime64('1970-01-01') - np.datetime64('1969-12-31')) > > Ou

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Benjamin Root
On Wed, Apr 3, 2013 at 7:52 PM, Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: > > Personally, I never need finer resolution than seconds, nor more than > a century, so it's no big deal to me, but just wondering > > A use case for finer resolution than seconds (in our field, no le

Re: [Numpy-discussion] feature tracking in numpy/scipy

2013-03-07 Thread Benjamin Root
On Sat, Mar 2, 2013 at 5:32 PM, Scott Collis wrote: > Good afternoon list, > I am looking at feature tracking in a 2D numpy array, along the lines of > Dixon and Wiener 1993 (for tracking precipitating storms) > > Identifying features based on threshold is quite trivial using > ndimage.label > >

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

2013-03-06 Thread Benjamin Root
On Tue, Mar 5, 2013 at 9:15 AM, Phil Elson wrote: > The ticket https://github.com/numpy/numpy/issues/2269 discusses the > possibility of implementing a "find first" style function which can > optimise the process of finding the first value(s) which match a predicate > in a given 1D array. For exa

Re: [Numpy-discussion] reshaping arrays

2013-03-04 Thread Benjamin Root
On Sat, Mar 2, 2013 at 11:35 PM, Sudheer Joseph wrote: > Hi Brad, > I am not getting the attribute reshape for the array, are > you having a different version of numpy than mine? > > I have > In [55]: np.__version__ > Out[55]: '1.7.0' > and detail of the shape > > details of variab

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

2013-02-26 Thread Benjamin Root
On Mon, Feb 25, 2013 at 8:23 PM, Alan G Isaac wrote: > I'm hoping this discussion will return to the drawing the line question. > > http://stackoverflow.com/questions/8108688/in-python-when-should-i-use-a-function-instead-of-a-method > > Alan Isaac > Proposed line: Reduction methods only. Disc

Re: [Numpy-discussion] a question about freeze on numpy 1.7.0

2013-02-24 Thread Benjamin Root
On Sun, Feb 24, 2013 at 8:16 PM, Ondřej Čertík wrote: > Hi Gelin, > > On Sun, Feb 24, 2013 at 12:08 AM, Gelin Yan wrote: > > Hi All > > > > When I used numpy 1.7.0 with cx_freeze 4.3.1 on windows, I quickly > > found out even a simple "import numpy" may lead to program failed with > > follow

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

2013-02-23 Thread Benjamin Root
On Sat, Feb 23, 2013 at 8:20 PM, wrote: > On Sat, Feb 23, 2013 at 3:33 PM, Robert Kern > wrote: > > On Sat, Feb 23, 2013 at 7:25 PM, Nathaniel Smith wrote: > >> On Sat, Feb 23, 2013 at 3:38 PM, Till Stensitzki > wrote: > >>> Hello, > >>> i know that the array object is already crowded, but i w

Re: [Numpy-discussion] Array accumulation in numpy

2013-02-19 Thread Benjamin Root
On Tue, Feb 19, 2013 at 10:00 AM, Tony Ladd wrote: > I want to accumulate elements of a vector (x) to an array (f) based on > an index list (ind). > > For example: > > x=[1,2,3,4,5,6] > ind=[1,3,9,3,4,1] > f=np.zeros(10) > > What I want would be produced by the loop > > for i=range(6): > f[i

Re: [Numpy-discussion] Where's that function?

2013-02-06 Thread Benjamin Root
On Wed, Feb 6, 2013 at 1:08 PM, wrote: > I'm convinced that I saw a while ago a function that uses a list of > interval boundaries to index into an array, either to iterate or to > take. > I thought that's very useful, but didn't make a note. > > Now, I have no idea where I saw this (I thought nu

Re: [Numpy-discussion] Dealing with the mode argument in qr.

2013-02-06 Thread Benjamin Root
On Tue, Feb 5, 2013 at 4:23 PM, Charles R Harris wrote: > Hi All, > > This post is to bring the discussion of PR > #2965to the attention of the list. > There are at least three issues in play here. > > 1) The PR adds modes 'big' and 'thin' to the current

Re: [Numpy-discussion] Issues to fix for 1.7.0rc2.

2013-02-06 Thread Benjamin Root
On Wed, Feb 6, 2013 at 4:18 AM, Dag Sverre Seljebotn < d.s.seljeb...@astro.uio.no> wrote: > On 02/06/2013 08:41 AM, Charles R Harris wrote: > > > > > > On Tue, Feb 5, 2013 at 11:50 PM, Jason Grout > > mailto:jason-s...@creativetrax.com>> > wrote: > > > > On 2/6/13 12:46 AM, Charles R Harris wr

Re: [Numpy-discussion] np.where: x and y need to have the same shape as condition ?

2013-01-29 Thread Benjamin Root
On Tue, Jan 29, 2013 at 6:16 AM, denis wrote: > Folks, > the doc for `where` says "x and y need to have the same shape as > condition" > http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.where.html > But surely > "where is equivalent to: > [xv if c else yv for (c,xv,yv) in z

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

2013-01-18 Thread Benjamin Root
On Fri, Jan 18, 2013 at 11:36 AM, Daniele Nicolodi wrote: > On 18/01/2013 15:19, Benjamin Root wrote: > > > > > > On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi > <mailto:dani...@grinta.net>> wrote: > > > > On 17/01/2013 23:27, Mark Wiebe wro

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

2013-01-18 Thread Benjamin Root
On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi wrote: > On 17/01/2013 23:27, Mark Wiebe wrote: > > Would it be too weird or clumsy to extend the empty and empty_like > > functions to do the filling? > > > > np.empty((10, 10), fill=np.nan) > > np.empty_like(my_arr, fill=np.nan) > > Wouldn't it b

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

2013-01-17 Thread Benjamin Root
On Thu, Jan 17, 2013 at 5:04 PM, Eric Firing wrote: > On 2013/01/17 4:13 AM, Pierre Haessig wrote: > > Hi, > > > > Le 14/01/2013 20:05, Benjamin Root a écrit : > >> I do like the way you are thinking in terms of the broadcasting > >> semantics, but I wonder

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

2013-01-17 Thread Benjamin Root
On Thu, Jan 17, 2013 at 8:54 AM, Jim Vickroy wrote: > On 1/16/2013 11:41 PM, Nathaniel Smith wrote: > > On 16 Jan 2013 17:54, 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) > > >

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

2013-01-14 Thread Benjamin Root
On Mon, Jan 14, 2013 at 1:56 PM, David Warde-Farley < d.warde.far...@gmail.com> wrote: > On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig > wrote: > > In [8]: tile(nan, (3,3)) # (it's a verb ! ) > > tile, in my opinion, is useful in some cases (for people who think in > terms of repmat()) but not

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

2013-01-14 Thread Benjamin Root
On Mon, Jan 14, 2013 at 12:27 PM, Eric Firing wrote: > On 2013/01/14 6:15 AM, Olivier Delalleau wrote: > > - I agree the name collision with np.ma.filled is a problem. I have no > > better suggestion though at this point. > > How about "initialized()"? > A verb! +1 from me! For those wondering,

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

2013-01-14 Thread Benjamin Root
On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig wrote: > Hi, > > Le 14/01/2013 00:39, Nathaniel Smith a écrit : > > (The nice thing about np.filled() is that it makes np.zeros() and > > np.ones() feel like clutter, rather than the reverse... not that I'm > > suggesting ever getting rid of them, bu

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

2013-01-09 Thread Benjamin Root
On Wed, Jan 9, 2013 at 9:58 AM, Nathaniel Smith wrote: > On Wed, Jan 9, 2013 at 2:53 PM, Alan G Isaac 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 a

Re: [Numpy-discussion] Support for python 2.4 dropped. Should we drop 2.5 also?

2012-12-13 Thread Benjamin Root
My apologies... we support 2.6 and above. +1 on dropping 2.5 support. Ben On Thu, Dec 13, 2012 at 1:12 PM, Benjamin Root wrote: > On Thu, Dec 13, 2012 at 12:38 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> The previous proposal to drop python 2.

Re: [Numpy-discussion] Support for python 2.4 dropped. Should we drop 2.5 also?

2012-12-13 Thread Benjamin Root
On Thu, Dec 13, 2012 at 12:38 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > The previous proposal to drop python 2.4 support garnered no opposition. > How about dropping support for python 2.5 also? > > Chuck > > matplotlib 1.2 supports py2.5. I haven't seen any plan to move off of t

Re: [Numpy-discussion] Proposal to drop python 2.4 support in numpy 1.8

2012-12-13 Thread Benjamin Root
As a point of reference, python 2.4 is on RH5/CentOS5. While RH6 is the current version, there are still enterprises that are using version 5. Of course, at this point, one really should be working on a migration plan and shouldn't be doing new development on those machines... Ben Root _

Re: [Numpy-discussion] Allowing 0-d arrays in np.take

2012-12-04 Thread Benjamin Root
On Tue, Dec 4, 2012 at 8:57 AM, Sebastian Berg wrote: > Hey, > > Maybe someone has an opinion about this (since in fact it is new > behavior, so it is undefined). `np.take` used to not allow 0-d/scalar > input but did allow any other dimensions for the indices. Thinking about > changing this, mean

Re: [Numpy-discussion] float32 to float64 casting

2012-11-17 Thread Benjamin Root
On Saturday, November 17, 2012, Charles R Harris wrote: > > > On Sat, Nov 17, 2012 at 1:00 PM, Olivier Delalleau > > > wrote: > >> 2012/11/17 Gökhan Sever > 'cvml', 'gokhanse...@gmail.com');>> >> >>> >>> >>> On Sat, Nov 17, 2012 at 9:47 AM, Nathaniel Smith >>> >>> > wrote: >>> On Fri, Nov

Re: [Numpy-discussion] the fast way to loop over ndarray elements?

2012-11-17 Thread Benjamin Root
On Saturday, November 17, 2012, Chao YUE wrote: > Dear all, > > I need to make a linear contrast of the 2D numpy array "data" from an > interval to another, the approach is: > I have another two list: "base" & "target", then I check for each ndarray > element "data[i,j]", > if base[m] =< data[i,

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

2012-11-12 Thread Benjamin Root
On Monday, November 12, 2012, Matthew Brett wrote: > Hi, > > On Mon, Nov 12, 2012 at 8:15 PM, Benjamin Root wrote: > > > > > > On Monday, November 12, 2012, Olivier Delalleau wrote: > >> > >> 2012/11/12 Nathaniel Smith > >>> > >&

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

2012-11-12 Thread Benjamin Root
On Monday, November 12, 2012, Benjamin Root wrote: > > > On Monday, November 12, 2012, Olivier Delalleau wrote: > >> 2012/11/12 Nathaniel Smith >> >>> On Mon, Nov 12, 2012 at 8:54 PM, Matthew Brett >>> wrote: >>> > Hi, >>> > &

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

2012-11-12 Thread Benjamin Root
On Monday, November 12, 2012, Olivier Delalleau wrote: > 2012/11/12 Nathaniel Smith 'n...@pobox.com');>> > >> On Mon, Nov 12, 2012 at 8:54 PM, Matthew Brett >> > 'matthew.br...@gmail.com');>> >> wrote: >> > Hi, >> > >> > I wanted to check that everyone knows about and is happy with the >> > scal

Re: [Numpy-discussion] Simple question about scatter plot graph

2012-10-31 Thread Benjamin Root
On Wednesday, October 31, 2012, wrote: > On Wed, Oct 31, 2012 at 8:59 PM, klo uo > > wrote: > > Thanks for your reply > > > > I suppose, variable length signals are split on equal parts and dominant > > harmonic is extracted. Then scatter plot shows this pattern, which has > some > > low correlati

Re: [Numpy-discussion] Regression in mpl: AttributeError: incompatible shape for a non-contiguous array

2012-10-29 Thread Benjamin Root
gt; --- > Patrick Marsh > Ph.D. Candidate / Liaison to the HWT > School of Meteorology / University of Oklahoma > Cooperative Institute for Mesoscale Meteorological Studies > National Severe Storms Laboratory > http://www.patricktmarsh.com > > > > On Mon, Oct 29, 2012 at

Re: [Numpy-discussion] Regression in mpl: AttributeError: incompatible shape for a non-contiguous array

2012-10-29 Thread Benjamin Root
On Mon, Oct 29, 2012 at 10:33 AM, Sebastian Berg wrote: > Hey, > > On Mon, 2012-10-29 at 09:54 -0400, Benjamin Root wrote: > > This error started showing up in the test suite for mpl when using > > numpy master. > > > > AttributeError: incompatible shape for a

[Numpy-discussion] Regression in mpl: AttributeError: incompatible shape for a non-contiguous array

2012-10-29 Thread Benjamin Root
This error started showing up in the test suite for mpl when using numpy master. AttributeError: incompatible shape for a non-contiguous array The tracebacks all point back to various code points where we are trying to set the shape of an array, e.g., offsets.shape = (-1, 2) Those lines haven't

Re: [Numpy-discussion] how to pipe into numpy arrays?

2012-10-24 Thread Benjamin Root
On Wed, Oct 24, 2012 at 3:00 PM, Michael Aye wrote: > As numpy.fromfile seems to require full file object functionalities > like seek, I can not use it with the sys.stdin pipe. > So how could I stream a binary pipe directly into numpy? > I can imagine storing the data in a string and use StringIO

Re: [Numpy-discussion] specifying numpy as dependency in your project, install_requires

2012-09-21 Thread Benjamin Root
On Fri, Sep 21, 2012 at 4:19 PM, Travis Oliphant wrote: > > On Sep 21, 2012, at 3:13 PM, Ralf Gommers wrote: > > Hi, > > An issue I keep running into is that packages use: > install_requires = ["numpy"] > or > install_requires = ['numpy >= 1.6'] > > in their setup.py. This simply doesn't w

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 4:42 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 2:33 PM, Travis Oliphant wrote: > >> >> On Sep 18, 2012, at 2:44 PM, Charles R Harris wrote: >> >> >> >> On Tue, Sep 18, 2012 at 1:35 PM, Benjamin Root wrote

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 3:25 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root wrote: > >> >> >> On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >&

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 3:19 PM, Ralf Gommers wrote: > > > On Tue, Sep 18, 2012 at 9:13 PM, Benjamin Root wrote: > >> >> >> On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >&

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: > >> >> >> On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >&

Re: [Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-18 Thread Benjamin Root
On Fri, Sep 7, 2012 at 12:05 PM, Nathaniel Smith wrote: > On 7 Sep 2012 14:38, "Benjamin Root" wrote: > > > > An issue just reported on the matplotlib-users list involved a user who > ran out of memory while attempting to do an imshow() on a large array. >

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris wrote: > > > On Mon, Sep 17, 2012 at 3:40 PM, Travis Oliphant wrote: > >> >> On Sep 17, 2012, at 8:42 AM, Benjamin Root wrote: >> >> > Consider the following code: >> > >> > import nump

[Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-17 Thread Benjamin Root
Consider the following code: import numpy as np a = np.array([1, 2, 3, 4, 5], dtype=np.int16) a *= float(255) / 15 In v1.6.x, this yields: array([17, 34, 51, 68, 85], dtype=int16) But in master, this throws an exception about failing to cast via same_kind. Note that numpy was smart about this o

[Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-07 Thread Benjamin Root
An issue just reported on the matplotlib-users list involved a user who ran out of memory while attempting to do an imshow() on a large array. While this wouldn't be totally unexpected, the user's traceback shows that they ran out of memory before any actual building of the image occurred. Memory

Re: [Numpy-discussion] broadcasting question

2012-08-30 Thread Benjamin Root
On Thursday, August 30, 2012, Neal Becker wrote: > I think this should be simple, but I'm drawing a blank > > I have 2 2d matrixes > > Matrix A has indexes (i, symbol) > Matrix B has indexes (state, symbol) > > I combined them into a 3d matrix: > > C = A[:,newaxis,:] + B[newaxis,:,:] > where C has

Re: [Numpy-discussion] ANN: NumPy 1.7.0b1 release

2012-08-23 Thread Benjamin Root
On Tue, Aug 21, 2012 at 12:24 PM, Ondřej Čertík wrote: > Hi, > > I'm pleased to announce the availability of the first beta release of > NumPy 1.7.0b1. > > Sources and binary installers can be found at > https://sourceforge.net/projects/numpy/files/NumPy/1.7.0b1/ > > Please test this release and r

Re: [Numpy-discussion] bug in numpy.where?

2012-07-27 Thread Benjamin Root
On Fri, Jul 27, 2012 at 3:58 PM, Andreas Mueller wrote: > Hi Everybody. > The bug is that no error is raised, right? > The docs say > > where(condition, [x, y]) > > x, y : array_like, optional > Values from which to choose. `x` and `y` need to have the same > shape as `condition` > > In

Re: [Numpy-discussion] bug in numpy.where?

2012-07-27 Thread Benjamin Root
On Thu, Jul 26, 2012 at 2:33 PM, Phil Hodge wrote: > On a Linux machine: > > > uname -srvop > Linux 2.6.18-308.8.2.el5 #1 SMP Tue May 29 11:54:17 EDT 2012 x86_64 > GNU/Linux > > this example shows an apparent problem with the where function: > > Python 2.7.1 (r271:86832, Dec 21 2010, 11:19:43) >

Re: [Numpy-discussion] Synonym standards

2012-07-27 Thread Benjamin Root
On Thu, Jul 26, 2012 at 7:12 PM, Robert Kern wrote: > On Fri, Jul 27, 2012 at 12:05 AM, Colin J. Williams > wrote: > > On 26/07/2012 4:57 PM, Benjamin Root wrote: > > > > > > On Thu, Jul 26, 2012 at 4:45 PM, Colin J. Williams wrote: > >> > >>

Re: [Numpy-discussion] Synonym standards

2012-07-26 Thread Benjamin Root
On Thu, Jul 26, 2012 at 4:45 PM, Colin J. Williams wrote: > It seems that these standards have been adopted, which is good: > > The following import conventions are used throughout the NumPy source and > documentation: > > import numpy as np > import matplotlib as mpl > import matplotlib.pyplot

Re: [Numpy-discussion] numpy.complex

2012-07-23 Thread Benjamin Root
On Monday, July 23, 2012, OC wrote: > > It's unPythonic just in the sense that it is unlike every other type > > constructor in Python. int(x) returns an int, list(x) returns a list, > > but np.complex64(x) sometimes returns a np.complex64, and sometimes it > > returns a np.ndarray, depending

Re: [Numpy-discussion] use slicing as argument values?

2012-07-12 Thread Benjamin Root
On Thursday, July 12, 2012, Chao YUE wrote: > Thanks all for the discussion. Actually I am trying to use something like > numpy ndarray indexing in the function. Like when I call: > > func(a,'1:3,:,2:4'), it knows I want to retrieve a[1:3,:,2:4], and > func(a,'1:3,:,4') for a[1:3,:,4] ect. > I am

Re: [Numpy-discussion] use slicing as argument values?

2012-07-12 Thread Benjamin Root
ery similar to the arguments for range() (with some exceptions/differences). Cheers! Ben Root > 2012/7/12 Benjamin Root > >> >> >> On Thu, Jul 12, 2012 at 3:38 PM, Chao YUE wrote: >> >>> Dear all, >>> >>> I want to create a function and

Re: [Numpy-discussion] use slicing as argument values?

2012-07-12 Thread Benjamin Root
On Thu, Jul 12, 2012 at 3:38 PM, Chao YUE wrote: > Dear all, > > I want to create a function and I would like one of the arguments of the > function to determine what slicing of numpy array I want to use. > a simple example: > > a=np.arange(100).reshape(10,10) > > suppose I want to have a imaging

Re: [Numpy-discussion] Remove current 1.7 branch?

2012-07-12 Thread Benjamin Root
On Thursday, July 12, 2012, Nathaniel Smith wrote: > On Thu, Jul 12, 2012 at 12:48 PM, Benjamin Root > > > wrote: > > > > > > On Thursday, July 12, 2012, Thouis (Ray) Jones wrote: > >> > >> On Thu, Jul 12, 2012 at 1:28 AM, Charles R Harris > &g

Re: [Numpy-discussion] Remove current 1.7 branch?

2012-07-12 Thread Benjamin Root
On Thursday, July 12, 2012, Thouis (Ray) Jones wrote: > On Thu, Jul 12, 2012 at 1:28 AM, Charles R Harris > > wrote: > > Hi All, > > > > Travis and I agree that it would be appropriate to remove the current > 1.7.x > > branch and branch again after a code freeze. That way we can avoid the > pain >

Re: [Numpy-discussion] build numpy 1.6.2

2012-07-10 Thread Benjamin Root
Prakash, On Tue, Jul 10, 2012 at 3:26 PM, Prakash Joshi wrote: > Thanks Ben. > > Also I did not specified any of BLAS, LAPACK, ATLAS libraries, do we > need these libraries for numpy? > "Need", no, you do not "need" them in the sense that NumPy does not require them to work. NumPy will work

Re: [Numpy-discussion] build numpy 1.6.2

2012-07-10 Thread Benjamin Root
On Tue, Jul 10, 2012 at 2:45 PM, Prakash Joshi wrote: > Hi All, > > I built numpy 1.6.2 on linux 64 bit and installed numpy in > site-packages, It pass all the test cases of numpy, but I am not sure if > this is good build; As I did not specified any fortran compiler while > setup, also I do n

Re: [Numpy-discussion] Looking for the most important bugs, documentation needs, etc.

2012-07-10 Thread Benjamin Root
On Tue, Jul 10, 2012 at 6:07 AM, Ralf Gommers wrote: > > > On Tue, Jul 10, 2012 at 11:36 AM, Ralf Gommers < > ralf.gomm...@googlemail.com> wrote: > >> >> >> On Tue, Jul 10, 2012 at 4:20 AM, Six Silberman >> wrote: >> >>> Hi all, >>> >>> Some colleagues and I are interested in contributing to nump

Re: [Numpy-discussion] Type specific sorts: objects, structured arrays, and all that.

2012-07-10 Thread Benjamin Root
On Tue, Jul 10, 2012 at 3:37 AM, Robert Kern wrote: > On Tue, Jul 10, 2012 at 4:32 AM, Charles R Harris > wrote: > > Hi All, > > > > I've been adding type specific sorts for object and structured arrays. It > > seems that datetime64 and timedelta64 are also not supported. Is there > any > > reas

Re: [Numpy-discussion] "import numpy" performance

2012-07-02 Thread Benjamin Root
On Mon, Jul 2, 2012 at 4:34 PM, Nathaniel Smith wrote: > On Mon, Jul 2, 2012 at 8:17 PM, Andrew Dalke > wrote: > > In this email I propose a few changes which I think are minor > > and which don't really affect the external NumPy API but which > > I think could improve the "import numpy" perform

Re: [Numpy-discussion] Created NumPy 1.7.x branch

2012-06-26 Thread Benjamin Root
On Tuesday, June 26, 2012, Thouis (Ray) Jones wrote: > On Tue, Jun 26, 2012 at 10:11 PM, Jason Grout > > wrote: > > On 6/26/12 3:06 PM, Dag Sverre Seljebotn wrote: > >> Something the Sage project does very well is meeting often in person > > > > Another thing we have that has improved the mailing

Re: [Numpy-discussion] Matrix rank default tolerance - is it too low?

2012-06-26 Thread Benjamin Root
On Tuesday, June 26, 2012, Charles R Harris wrote: > > > On Tue, Jun 26, 2012 at 3:42 PM, Matthew Brett wrote: > > Hi, > > On Mon, Jun 18, 2012 at 3:50 PM, Matthew Brett > wrote: > > Hi, > > > > On Sun, Jun 17, 2012 at 7:22 PM, Charles R Harris > > wrote: > >> > >> > >> On Sat, Jun 16, 2012 at 2

Re: [Numpy-discussion] Created NumPy 1.7.x branch

2012-06-26 Thread Benjamin Root
On Tue, Jun 26, 2012 at 12:48 PM, David Cournapeau wrote: > On Tue, Jun 26, 2012 at 5:24 PM, Travis Oliphant > wrote: > > > >> Let us note that that problem was due to Travis convincing David to > >> include the Datetime work in the release against David's own best > judgement. > >> The result wa

Re: [Numpy-discussion] Created NumPy 1.7.x branch

2012-06-25 Thread Benjamin Root
On Mon, Jun 25, 2012 at 1:41 PM, Travis Oliphant wrote: > >> C was famous for bugs due to the lack of function prototypes. This was >> fixed with C99 and the stricter typing was a great help. >> >> >> Bugs are not "due to lack of function prototypes". Bugs are due to >> mistakes that programmers

Re: [Numpy-discussion] Good way to develop numpy as popular choice!

2012-06-22 Thread Benjamin Root
On Fri, Jun 22, 2012 at 10:25 AM, Travis Oliphant wrote: > Accessing individual elements of NumPy arrays is slower than accessing > individual elements of lists --- around 2.5x-3x slower.NumPy has to do > more work to figure out what kind of indexing you are trying to do because > of its flexi

Re: [Numpy-discussion] Good way to develop numpy as popular choice!

2012-06-22 Thread Benjamin Root
On Fri, Jun 22, 2012 at 9:42 AM, eat wrote: > Hi, > > On Fri, Jun 22, 2012 at 7:51 AM, Gael Varoquaux < > gael.varoqu...@normalesup.org> wrote: > >> On Thu, Jun 21, 2012 at 08:59:09PM -0400, Benjamin Root wrote: >> > > munkres seems to be a pure pytho

Re: [Numpy-discussion] Good way to develop numpy as popular choice!

2012-06-21 Thread Benjamin Root
On Thursday, June 21, 2012, Robert Kern wrote: > On Thu, Jun 21, 2012 at 7:33 PM, eat > > wrote: > > Heh, > > > > On Thu, Jun 21, 2012 at 6:03 PM, Robert Kern > > > > wrote: > >> > >> On Thu, Jun 21, 2012 at 3:59 PM, bob tnur > >> > > wrote: > >> > Hi all numpy fun;) > >> > This question is alre

[Numpy-discussion] boolean indexing of structured arrays

2012-06-06 Thread Benjamin Root
Not sure if this is a bug or not. I am using a fairly recent master branch. >>> # Setting up... >>> import numpy as np >>> a = np.zeros((10, 1), dtype=[('foo', 'f4'), ('bar', 'f4'), ('spam', 'f4')]) >>> a['foo'] = np.random.random((10, 1)) >>> a['bar'] = np.random.random((10, 1)) >>> a['spam'] =

Re: [Numpy-discussion] varargs for logical_or, etc

2012-06-05 Thread Benjamin Root
On Tue, Jun 5, 2012 at 10:37 AM, Robert Kern wrote: > On Tue, Jun 5, 2012 at 2:54 PM, Neal Becker wrote: > > I think it's unfortunate that functions like logical_or are limited to > binary. > > > > As a workaround, I've been using this: > > > > def apply_binary (func, *args): > >if len (args

Re: [Numpy-discussion] 1D array sorting ascending and descending by fields

2012-06-05 Thread Benjamin Root
On Tue, Jun 5, 2012 at 10:49 AM, Nathaniel Smith wrote: > On Tue, Jun 5, 2012 at 1:17 AM, Benjamin Root wrote: > > > > > > On Monday, June 4, 2012, Chris Barker wrote: > >> > >> On Mon, Jun 4, 2012 at 11:10 AM, Patrick Redmond > >> wrote:

Re: [Numpy-discussion] 1D array sorting ascending and descending by fields

2012-06-04 Thread Benjamin Root
On Monday, June 4, 2012, Chris Barker wrote: > On Mon, Jun 4, 2012 at 11:10 AM, Patrick Redmond > > > wrote: > > Here's how I sorted primarily by field 'a' descending and secondarily by > > field 'b' ascending: > > could you multiply the numeric field by -1, sort, then put it back -- > somethign

Re: [Numpy-discussion] some typestrings not recognized anymore

2012-06-03 Thread Benjamin Root
On Sunday, June 3, 2012, Ralf Gommers wrote: > > > On Sun, Jun 3, 2012 at 4:49 PM, Nathaniel Smith > > > wrote: > >> On Sun, Jun 3, 2012 at 3:28 PM, Ralf Gommers >> > 'ralf.gomm...@googlemail.com');>> wrote: >> > Hi, >> > >> > Just ran into this: >> > >> np.__version__ >> > '1.5.1' >>

Re: [Numpy-discussion] better error message possible?

2012-06-01 Thread Benjamin Root
On Fri, Jun 1, 2012 at 9:14 AM, Nathaniel Smith wrote: > On Fri, Jun 1, 2012 at 10:46 AM, Chris Withers > wrote: > > Hi All, > > > > Any reason why this: > > > > >>> import numpy > > >>> numpy.zeros(10)[-123] > > Traceback (most recent call last): > > File "", line 1, in > > IndexError: ind

Re: [Numpy-discussion] indexes in an array where value is greater than 1?

2012-05-27 Thread Benjamin Root
On Sunday, May 27, 2012, Chao YUE wrote: > for me, np.nonzero() and np.where() both work. It seems they have same > function. > > chao They are not identical. Nonzeros is for indices. The where function is really meant for a different purpose, but special-cases for this call signature. Ben Root

<    1   2   3   4   5   6   7   >