[Numpy-discussion] np.nonzero behavior with multidimensional arrays

2015-02-22 Thread Jaime Fernández del Río
This was raised in SO today: http://stackoverflow.com/questions/28663142/why-is-np-wheres-result-read-only-for-multi-dimensional-arrays/28664009 np.nonzero (and np.where for boolean arrays) behave differently for 1-D and higher dimensional arrays: In the first case, a tuple with a single behaved

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Nathaniel Smith
On Feb 22, 2015 3:39 PM, "Aldcroft, Thomas" wrote: > > > > On Sun, Feb 22, 2015 at 5:56 PM, Aldcroft, Thomas < aldcr...@head.cfa.harvard.edu> wrote: >> >> >> >> On Sun, Feb 22, 2015 at 5:46 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: >>> >>> >>> >>> On Sun, Feb 22, 2015 at 3:40 PM, Al

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Aldcroft, Thomas
On Sun, Feb 22, 2015 at 5:56 PM, Aldcroft, Thomas < aldcr...@head.cfa.harvard.edu> wrote: > > > On Sun, Feb 22, 2015 at 5:46 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Sun, Feb 22, 2015 at 3:40 PM, Aldcroft, Thomas < >> aldcr...@head.cfa.harvard.edu> wrote: >> >>> >>>

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Nathaniel Smith
On Sun, Feb 22, 2015 at 2:46 PM, Charles R Harris wrote: > > On Sun, Feb 22, 2015 at 3:40 PM, Aldcroft, Thomas > wrote: >> >> >> >> On Sun, Feb 22, 2015 at 2:52 PM, Nathaniel Smith wrote: >>> >>> On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas >>> wrote: >>> > The idea of a one-byte string d

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Aldcroft, Thomas
On Sun, Feb 22, 2015 at 5:46 PM, Charles R Harris wrote: > > > On Sun, Feb 22, 2015 at 3:40 PM, Aldcroft, Thomas < > aldcr...@head.cfa.harvard.edu> wrote: > >> >> >> On Sun, Feb 22, 2015 at 2:52 PM, Nathaniel Smith wrote: >> >>> On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas >>> wrote: >>>

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Nathaniel Smith
On Sun, Feb 22, 2015 at 2:42 PM, Charles R Harris wrote: > > On Sun, Feb 22, 2015 at 12:52 PM, Nathaniel Smith wrote: >> >> On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas >> wrote: >> > The idea of a one-byte string dtype has been extensively discussed twice >> > before, with a lot of good i

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Charles R Harris
On Sun, Feb 22, 2015 at 3:40 PM, Aldcroft, Thomas < aldcr...@head.cfa.harvard.edu> wrote: > > > On Sun, Feb 22, 2015 at 2:52 PM, Nathaniel Smith wrote: > >> On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas >> wrote: >> > The idea of a one-byte string dtype has been extensively discussed twice

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Charles R Harris
On Sun, Feb 22, 2015 at 12:52 PM, Nathaniel Smith wrote: > On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas > wrote: > > The idea of a one-byte string dtype has been extensively discussed twice > > before, with a lot of good input and ideas, but no action [1, 2]. > > > > tl;dr: Perfect is the

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Aldcroft, Thomas
On Sun, Feb 22, 2015 at 2:52 PM, Nathaniel Smith wrote: > On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas > wrote: > > The idea of a one-byte string dtype has been extensively discussed twice > > before, with a lot of good input and ideas, but no action [1, 2]. > > > > tl;dr: Perfect is the e

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Sturla Molden
On 22/02/15 20:57, Nathaniel Smith wrote: > This is a discussion about how strings are represented as bit-patterns > inside ndarrays; the internal storage representation used by 'str' is > irrelevant. I thought it would be clever to just use the same internal representation as Python would choos

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Sturla Molden
On 22/02/15 21:04, Robert Kern wrote: > Python 3's `str` type is opaque, so it can > freely choose how to represent the data in memory. numpy dtypes > transparently describe how the data is represented in memory. Hm, yes, that is a good point. Sturla ___

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Robert Kern
On Sun, Feb 22, 2015 at 7:29 PM, Sturla Molden wrote: > > On 22/02/15 19:21, Aldcroft, Thomas wrote: > > > Problems like this are now showing up in the wild [3]. Workarounds are > > also showing up, like a way to easily convert from 'S' to 'U' within > > astropy Tables [4], but this is really not

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Nathaniel Smith
On Sun, Feb 22, 2015 at 11:29 AM, Sturla Molden wrote: > On 22/02/15 19:21, Aldcroft, Thomas wrote: > >> Problems like this are now showing up in the wild [3]. Workarounds are >> also showing up, like a way to easily convert from 'S' to 'U' within >> astropy Tables [4], but this is really not a d

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Nathaniel Smith
On Sun, Feb 22, 2015 at 10:21 AM, Aldcroft, Thomas wrote: > The idea of a one-byte string dtype has been extensively discussed twice > before, with a lot of good input and ideas, but no action [1, 2]. > > tl;dr: Perfect is the enemy of good. Can numpy just add a one-byte string > dtype named 's'

Re: [Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Sturla Molden
On 22/02/15 19:21, Aldcroft, Thomas wrote: > Problems like this are now showing up in the wild [3]. Workarounds are > also showing up, like a way to easily convert from 'S' to 'U' within > astropy Tables [4], but this is really not a desirable way to go. > Gigabyte-sized string data arrays are no

[Numpy-discussion] One-byte string dtype: third time's the charm?

2015-02-22 Thread Aldcroft, Thomas
The idea of a one-byte string dtype has been extensively discussed twice before, with a lot of good input and ideas, but no action [1, 2]. tl;dr: Perfect is the enemy of good. Can numpy just add a one-byte string dtype named 's' that uses latin-1 encoding as a bridge to enable Python 3 usage in t