Closed
Description
Should modify the docstring accordingly, raise a meaningful error, or (preferably) make it work by hidding some logic under the hood.
Traceback:
In [11]: x = np.array([[True, True], [False, False]])
In [12]: np.diff(x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-12-59225436601c> in <module>()
----> 1 np.diff(x)
/usr/lib/python3.6/site-packages/numpy/lib/function_base.py in diff(a, n, axis)
1924 return diff(a[slice1]-a[slice2], n-1, axis=axis)
1925 else:
-> 1926 return a[slice1]-a[slice2]
1927
1928
TypeError: numpy boolean subtract, the `-` operator, is deprecated, use the bitwise_xor, the `^` operator, or the logical_xor function instead.
In [13]: np.__version__
Out[13]: '1.13.0'