<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 27, 2018 at 1:46 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span class=""><div dir="ltr">On Mon, Aug 27, 2018 at 11:37 AM Robert Kern <<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 27, 2018 at 10:30 AM Tyler Reddy <<a href="mailto:tyler.je.reddy@gmail.com" target="_blank">tyler.je.reddy@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Chuck suggested ( <a href="https://github.com/numpy/numpy/pull/11805#issuecomment-416069436" target="_blank">https://github.com/numpy/<wbr>numpy/pull/11805#issuecomment-<wbr>416069436</a> ) 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.<div><br></div><div>Related discussion on SO: <a href="https://stackoverflow.com/questions/39014324/difference-between-numpy-ediff1d-and-diff" target="_blank">https://stackoverflow.com/<wbr>questions/39014324/difference-<wbr>between-numpy-ediff1d-and-diff</a></div><div><br></div><div>Thoughts?</div></div></blockquote><div><br></div><div>Huh. Never knew this existed. I'd say about 50% of the time I use np.diff(), I'm doing that prepend/append behavior manually (and less readably, possibly inefficiently, but most importantly annoyingly).</div></div></div></blockquote></span></div></div></blockquote><div><br></div><div>same for me</div><div>never seen, never used</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div><br></div></span><div>I was thinking we might want to add something to `np.diff`, maybe using `np.pad`.</div></div></div></blockquote><div><br></div><div>ediff1d avoids one extra temp array compared to simple padding.</div><div><br></div><div>However, ediff1d pads the final, difference array instead of the original data array.</div><div><br></div><div>AFAIR, I almost always need padding of the original array.</div><div><br></div><div>eg as in the standard example of round tripping between cumsum and diff</div><div><br></div><div>Josef</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>Chuck </div></div></div>
<br>______________________________<wbr>_________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/numpy-<wbr>discussion</a><br>
<br></blockquote></div><br></div></div>