<div dir="ltr"><div>I don't particularly need this, although it would be nice to make this behavior explicit, instead of happening more or less by accident:</div><div><br></div><div> In [1]: from yt.units import km<br><br> In [2]: import numpy as np<br><br> In [3]: data = [1, 2, 3]*km<br><br> In [4]: np.ones_like(data)<br> Out[4]: YTArray([1., 1., 1.]) km<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 18, 2018 at 9:51 AM, Marten van Kerkwijk <span dir="ltr"><<a href="mailto:m.h.vankerkwijk@gmail.com" target="_blank">m.h.vankerkwijk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm greatly in favour, especially if the same can be done for<br>
`zeros_like` and `empty_like`, but note that a tricky part is that<br>
ufuncs do not deal very graciously with structured (void) and string<br>
dtypes. -- Marten<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>
</blockquote></div><br></div>