<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 3, 2016 at 9:17 AM, Yuri Sukhov <span dir="ltr"><<a href="mailto:yuri.sukhov@gmail.com" target="_blank">yuri.sukhov@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">Hi all,<div><br></div><div>According to the documentation for numpy.rint() (<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.rint.html" target="_blank">https://docs.scipy.org/doc/nu<wbr>mpy/reference/generated/numpy.<wbr>rint.html</a>), it's a ufunc that accepts an array-like object as an input.</div><div><br></div><div>But it also works with scalar inputs. Could anyone clarify if such use case is considered to be common and acceptable? It it just the documentation that does not cover one of the possible scenarios, or is it a side effect and such use case should be avoided?</div><div><br></div><div>I want to use rint() with scalars as I have not found an alternative with the same behavior in cPython, but if it's not how it should be used, I don't want to rewrite the app when that behavior will change.</div><div><br clear="all"></div></div></blockquote><div><br></div><div>Scalars are array_like, they can be converted to arrays.<br><br></div><div>Chuck <br></div></div><br></div></div>