[Numpy-discussion] empty chararrays (ticket 1948)

Ralf Gommers ralf.gommers@googlemail....
Sat Apr 7 08:19:41 CDT 2012


On Sun, Mar 25, 2012 at 7:09 PM, Ralf Gommers
<ralf.gommers@googlemail.com>wrote:

>
>
> On Sun, Mar 25, 2012 at 7:03 PM, Charles R Harris <
> charlesr.harris@gmail.com> wrote:
>
>>
>>
>> On Sun, Mar 25, 2012 at 10:12 AM, Ralf Gommers <
>> ralf.gommers@googlemail.com> wrote:
>>
>>> Hi,
>>>
>>> In ticket 1948 a backwards compatibility issue with chararray is
>>> reported. Indexing a chararray with [] or a bool array of False used to
>>> return [] in numpy 1.2.1 (consistent with ndarray behavior), but now
>>> returns an empty string. Unfortunately this changed behavior has been
>>> present for the 1.5.x and 1.6.x releases.
>>>
>>> So the question is if this should be changed back or not? The change was
>>> likely unintentional; there's no test for it.
>>>
>>>
>> I believe the stsci folks were maintaining chararray, although I don't
>> see anyone from there with commit permissions. Hmm... I'd be inclined to
>> reinstate the old behavior, but the stsci folks may have deliberately made
>> the change, I'd like to hear from them first.
>>
>
> The change was made by Michael Droettboom (CC'd), who did have commit
> permissions for this. They got lost with the Github move it seems.
>

I've sent a PR for this, https://github.com/numpy/numpy/pull/247, which
changes chararray to return an empty chararray for indexing with an empty
array/list.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120407/ec5d6877/attachment-0001.html 


More information about the NumPy-Discussion mailing list