[Numpy-discussion] Possible Deprecation of np.ediff1d

Stephan Hoyer shoyer at gmail.com
Mon Aug 27 22:04:26 EDT 2018


On Mon, Aug 27, 2018 at 10:30 AM Tyler Reddy <tyler.je.reddy at gmail.com>
wrote:

> Chuck suggested (
> https://github.com/numpy/numpy/pull/11805#issuecomment-416069436 ) that
> we may want to consider deprecating np.ediff1d, which is perhaps not much
> more useful than np.diff, apart from having some arguably strange prepend /
> append behavior added in.
>
> Related discussion on SO:
> https://stackoverflow.com/questions/39014324/difference-between-numpy-ediff1d-and-diff
>
> Thoughts?
>
> Best wishes,
> Tyler
>

I don't think there's much to be gained by dropping edit1d from NumPy. It's
really not a maintenance burden to keep it around unchanged.

My preference, in keeping with our tradition of not unnecessarily causing
disruption, would be to keep this function around but mention that np.diff
should be preferred for almost all use cases in the docs. This is "Official
discouragement" strategy that came up in the recent discussion about our
deprecation policy:
https://mail.python.org/pipermail/numpy-discussion/2018-July/078474.html

I did a search in Google's codebase and turned up only a handful of uses
(~20 uses total) but in a variety of different projects:
- It appears in astropy, dask, pandas, pint, scipy and TensorFlow.
- It used in six different internal projects

Cheers,
Stephan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180827/c0709775/attachment.html>


More information about the NumPy-Discussion mailing list