Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 7:33 PM, Allan Haldane wrote: > On 01/30/2018 04:54 PM, josef.p...@gmail.com wrote: > > > > > > On Tue, Jan 30, 2018 at 3:21 PM, Allan Haldane > > wrote: > > > > On 01/30/2018 01:33 PM, josef.p...@gmail.com > >

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread Allan Haldane
On 01/30/2018 04:54 PM, josef.p...@gmail.com wrote: > > > On Tue, Jan 30, 2018 at 3:21 PM, Allan Haldane > wrote: > > On 01/30/2018 01:33 PM, josef.p...@gmail.com > wrote: > > AFAICS, one problem is that the padded view di

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 3:21 PM, Allan Haldane wrote: > On 01/30/2018 01:33 PM, josef.p...@gmail.com wrote: > > AFAICS, one problem is that the padded view didn't come with the > > matching down stream usage support, the pack function as mentioned, an > > alternative way to convert to a standard

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread Allan Haldane
On 01/30/2018 01:33 PM, josef.p...@gmail.com wrote: > AFAICS, one problem is that the padded view didn't come with the > matching down stream usage support, the pack function as mentioned, an > alternative way to convert to a standard ndarray, copy doesn't get rid > of the padding and so on. > > e

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 1:33 PM, wrote: > > > On Tue, Jan 30, 2018 at 12:28 PM, Allan Haldane > wrote: > >> On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: >> >>> >>> >>> On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane >> > wrote: >>> >>> On 01/29/2018 05:5

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 2:42 PM, wrote: > > > On Tue, Jan 30, 2018 at 1:33 PM, wrote: > >> >> >> On Tue, Jan 30, 2018 at 12:28 PM, Allan Haldane >> wrote: >> >>> On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: >>> On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane >>>

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 12:28 PM, Allan Haldane wrote: > On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: > >> >> >> On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane > > wrote: >> >> On 01/29/2018 05:59 PM, josef.p...@gmail.com >>

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread Allan Haldane
On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane > wrote: On 01/29/2018 05:59 PM, josef.p...@gmail.com wrote: On Mon, Jan 29, 2018 at 5:50 PM, mailto:josef.p...@g

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread Chris Barker
On Mon, Jan 29, 2018 at 7:44 PM, Allan Haldane wrote: > I suggest that if we want to allow either means over fields, or conversion > of a n-D structured array to an n+1-D regular ndarray, we should add a > dedicated function to do so in numpy.lib.recfunctions > which does not depend on the binary

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 3:24 AM, Eric Wieser wrote: > Because dtypes were low level with clear memory layout and stayed that way > > Dtypes have supported padded and out-of-order-fields since at least 2005 > (v0.8.4) >

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-30 Thread Eric Wieser
Because dtypes were low level with clear memory layout and stayed that way Dtypes have supported padded and out-of-order-fields since at least 2005 (v0.8.4) , and I would gue

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane wrote: > On 01/29/2018 05:59 PM, josef.p...@gmail.com wrote: > >> >> >> On Mon, Jan 29, 2018 at 5:50 PM, > josef.p...@gmail.com>> wrote: >> >> >> >> On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane >> mailto:allanhald...@gmail.com>> wrote: >>

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Allan Haldane
On 01/29/2018 05:59 PM, josef.p...@gmail.com wrote: On Mon, Jan 29, 2018 at 5:50 PM, > wrote: On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane mailto:allanhald...@gmail.com>> wrote: On 01/29/2018 04:02 PM, josef.p...@gmail.com

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 5:50 PM, wrote: > > > On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane > wrote: > >> On 01/29/2018 04:02 PM, josef.p...@gmail.com wrote: >> > >> > >> > On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root > > > wrote: >> > >> > I <3 structured arr

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane wrote: > On 01/29/2018 04:02 PM, josef.p...@gmail.com wrote: > > > > > > On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root > > wrote: > > > > I <3 structured arrays. I love the fact that I can access data by > > row

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Allan Haldane
On 01/29/2018 04:02 PM, josef.p...@gmail.com wrote: > > > On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root > wrote: > > I <3 structured arrays. I love the fact that I can access data by > row and then by fieldname, or vice versa. There are times when I > n

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root wrote: > I <3 structured arrays. I love the fact that I can access data by row and > then by fieldname, or vice versa. There are times when I need to pass just > a column into a function, and there are times when I need to process things > row by row

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Benjamin Root
I <3 structured arrays. I love the fact that I can access data by row and then by fieldname, or vice versa. There are times when I need to pass just a column into a function, and there are times when I need to process things row by row. Yes, pandas is nice if you want the specialized indexing featu

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 2:55 PM, Stefan van der Walt wrote: > On Mon, 29 Jan 2018 14:10:56 -0500, josef.p...@gmail.com wrote: > >> Given that there is pandas, xarray, dask and more, numpy could as well >> drop >> any pretense of supporting dataframe_likes. Or, adjust the recfunctions so >> we can

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Stefan van der Walt
On Mon, 29 Jan 2018 14:10:56 -0500, josef.p...@gmail.com wrote: Given that there is pandas, xarray, dask and more, numpy could as well drop any pretense of supporting dataframe_likes. Or, adjust the recfunctions so we can still work dataframe_like with structured dtypes/recarrays/recfunctions.

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 1:22 PM, Eric Wieser wrote: > I think that there's a lot of confusion going around about recarrays vs > structured arrays. > > [`recarray`](https://github.com/numpy/numpy/blob/v1.13.0/ > numpy/core/records.py) are a wrapper around structured arrays that > provide: > * Attr

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Eric Wieser
I think that there's a lot of confusion going around about recarrays vs structured arrays. [`recarray`]( https://github.com/numpy/numpy/blob/v1.13.0/numpy/core/records.py) are a wrapper around structured arrays that provide: * Attribute access to fields as `arr.field` in addition to the normal `ar

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Chris Barker
On Sat, Jan 27, 2018 at 8:50 PM, Allan Haldane wrote: > On 01/26/2018 06:01 PM, josef.p...@gmail.com wrote: > >> I thought recarrays were pretty cool back in the day, but pandas is >> a much better option. >> >> So I pretty much only use structured arrays for data exchange with C >>

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-27 Thread Allan Haldane
On 01/26/2018 06:01 PM, josef.p...@gmail.com wrote: I thought recarrays were pretty cool back in the day, but pandas is a much better option. So I pretty much only use structured arrays for data exchange with C code My impression is that this turns into a deprecate recarrays

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread josef . pktd
On Fri, Jan 26, 2018 at 5:48 PM, Chris Barker wrote: > On Fri, Jan 26, 2018 at 2:35 PM, Allan Haldane > wrote: > >> As I remember, numpy has some fairly convoluted code for array creation >> which tries to make sense of various nested lists/tuples/ndarray >> combinations. It makes a difference f

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Chris Barker
On Fri, Jan 26, 2018 at 2:35 PM, Allan Haldane wrote: > As I remember, numpy has some fairly convoluted code for array creation > which tries to make sense of various nested lists/tuples/ndarray > combinations. It makes a difference for structured arrays and object > arrays. I don't remember the

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Allan Haldane
On 01/26/2018 03:38 PM, Chris Barker wrote: > I was hoping it would dig down to the inner structures looking for a > match to the dtype, rather than looking at the type of the top level. Oh > well. > > So yeah, not sure where you would go from tuple to list -- probably at > the bottom level, but t

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Eric Wieser
arr.names should have been arr.dtype.names in that pack_last_axis function Eric ​ On Fri, 26 Jan 2018 at 12:45 Chris Barker wrote: > On Fri, Jan 26, 2018 at 10:48 AM, Allan Haldane > wrote: > >> > What do folks think about a totuple() method — even before this I’ve >> > wanted that. But in t

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Chris Barker
On Fri, Jan 26, 2018 at 10:48 AM, Allan Haldane wrote: > > What do folks think about a totuple() method — even before this I’ve > > wanted that. But in this case, it seems particularly useful. > > Two thoughts: > > 1. `totuple` makes most sense for 2d arrays. But what should it do for > 1d or 3

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Eric Wieser
Apologies, it seems that I skipped to the end of @ahaldane's remark - we're on the same page. On Fri, 26 Jan 2018 at 11:17 Eric Wieser wrote: > Why is the list of tuples a useful thing to have in the first place? If > the goal is to convert an array into a structured array, you can do that > far

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Eric Wieser
Why is the list of tuples a useful thing to have in the first place? If the goal is to convert an array into a structured array, you can do that far more efficiently with: def make_tup_dtype(arr): """ Attempt to make a type capable of viewing the last axis of an array, even if it is non-co

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-26 Thread Allan Haldane
On 01/25/2018 08:53 PM, Chris Barker - NOAA Federal wrote: >> On Jan 25, 2018, at 4:06 PM, Allan Haldane wrote: > >>> 1) This is a known change with good reason? > >> . The >> change occurred because the old assignment behavior was dangerous, and >> was not doing what you thought. > > OK, that’

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-25 Thread Chris Barker - NOAA Federal
> On Jan 25, 2018, at 4:06 PM, Allan Haldane wrote: >> 1) This is a known change with good reason? > . The > change occurred because the old assignment behavior was dangerous, and > was not doing what you thought. OK, that’s a good reason! >> A) improve the error message. > > Good idea. I'll s

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-25 Thread Allan Haldane
On 01/25/2018 06:06 PM, Chris Barker wrote: > Hi all, > > I'm pretty sure this is the same thing as recently discussed on this > list about 1.14, but to confirm: > > I had failures in my code with an upgrade for 1.14 -- turns out it was a > single line in a single test fixture, so no big deal, bu

[Numpy-discussion] Setting custom dtypes and 1.14

2018-01-25 Thread Chris Barker
Hi all, I'm pretty sure this is the same thing as recently discussed on this list about 1.14, but to confirm: I had failures in my code with an upgrade for 1.14 -- turns out it was a single line in a single test fixture, so no big deal, but a regression just the same, with no deprecation warning.