Re: [Numpy-discussion] Interpolation using `np.interp()` with periodic x-coordinates

2014-10-01 Thread Charles R Harris
On Wed, Sep 24, 2014 at 3:57 PM, Saullo Castro wrote: > From the closed pull request PR #5109: > > https://github.com/numpy/numpy/pull/5109 > > it came out that the a good implementation would be adding a parameter > `period`. I would like to know about the community's interest for this > impleme

Re: [Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-10-01 Thread Eelco Hoogendoorn
Ah yes; you can use.. from types import MethodType ...to dynamically add methods to specific instances of a type. This may be cleaner or more pythonic than performing a check within the method, I dunno. On Wed, Oct 1, 2014 at 4:41 PM, Benjamin Root wrote: > Actually, if I remember correctly, s

Re: [Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-10-01 Thread Benjamin Root
Actually, if I remember correctly, special methods show up in the ndarray object when the dtype is datetime64, right? On Wed, Oct 1, 2014 at 10:13 AM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: > Well, the method will have to be present on all ndarrays, since structured > arrays do n

Re: [Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-10-01 Thread Eelco Hoogendoorn
Well, the method will have to be present on all ndarrays, since structured arrays do not have a different type from regular arrays, only a different dtype. Thus the attribute has to be present regardless, but some Exception will have to be raised depending on the dtype, to make it quack like the ki

Re: [Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-10-01 Thread John Zwinck
On 1 Oct 2014 04:30, "Stephan Hoyer" wrote: > > On Tue, Sep 30, 2014 at 1:22 PM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: >> >> On more careful reading of your words, I think we agree; indeed, if keys() is present is should return an iterable; but I don't think it should be present