<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 12, 2013 at 6:36 PM, Chris Barker - NOAA Federal <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Jun 12, 2013 at 5:10 AM, Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br>
<br>
> Personally I think that overloading np.empty is horribly ugly, will<br>
> continue confusing newbies and everyone else indefinitely, and I'm<br>
> 100% convinced that we'll regret implementing such a warty interface<br>
> for something that should be so idiomatic.<br></div></blockquote><div><br></div><div>I agree.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
</div>...<br>
<div class="im"> deprecate np.ma.filled</div></blockquote><div><br></div><div>Please don't. Rather just live with the inconsistency between numpy and <a href="http://numpy.ma">numpy.ma</a> APIs. If that bothers you, just tell yourself that we'll get an NA dtype at some point and that that will make <a href="http://numpy.ma">numpy.ma</a> much less important:)<br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"> in favor<br>
> of masked_array.filled (which does exactly the same thing) and<br>
> eventually switch np.ma.filled to be consistent with the new<br>
> np.filled.<br>
<br>
</div>+1<br>
<div class="im"><br>
> I also don't really see why an np.empty() constructor exists, it seems<br>
> to do the same thing that np.ndarray() does.<br>
<br>
</div>I had always assumed that np.ndarray() was a "low-level" interce that<br>
you really don't want to use in regular code (maybe for subclassing<br>
array...), as the docs say:<br>
<br>
"""<br>
Arrays should be constructed using `array`, `zeros` or `empty` (refer<br>
<div class="im">to the See Also section below). The parameters given here refer to<br>
</div>a low-level method (`ndarray(...)`) for instantiating an array.<br>
"""<br>
<br>
Am I wrong? is there any reason )other than history to have np.empty()<br>
<br>
But in any case, I like np.filled(), as being analogous to ones(),<br>
zeros() and empty()...</blockquote><div><br></div><div>I like np.filled as well. np.fill_with sounds fine too.<br><br></div><div>Ralf<br> <br></div></div></div></div>