[Numpy-discussion] np.diff on boolean arrays now raises

Ralf Gommers ralf.gommers at gmail.com
Thu Jun 15 06:35:36 EDT 2017


On Thu, Jun 15, 2017 at 7:08 PM, Jaime Fernández del Río <
jaime.frio at gmail.com> wrote:

> There is an ongoing discussion on github:
>
> https://github.com/numpy/numpy/issues/9251
>
> In 1.13 np.diff has started raising on boolean arrays, since subtraction
> of  boolean arrays is now deprecated.
>
> A decision has to be made whether:
>
>    - raising an error is the correct thing to do, and only the docstring
>    needs updating, or
>    - backwards compatibility is more important and diff should still work
>    on boolean arrays.
>
>
The issue is bigger than np.diff. For example, there's a problem with the
scipy.ndimage morphology functions (
https://github.com/scipy/scipy/issues/7493) that looks pretty serious. All
ndimage.binary_* functions (7 of them) for example return boolean arrays,
and chaining those is now broken. Unfortunately it seems that that wasn't
covered by the ndimage test suite.

Possibly reverting the breaking change in 1.13.1 is the best way to fix
this.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170615/38bf527b/attachment.html>


More information about the NumPy-Discussion mailing list