<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 12, 2013 at 2:00 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</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"><p dir="ltr">On 12 Jun 2013 18:20, "Ralf Gommers" <<a href="mailto:ralf.gommers@gmail.com" target="_blank">ralf.gommers@gmail.com</a>> wrote:<br>

><br>
><br>
><br>
><br>
> On Wed, Jun 12, 2013 at 6:36 PM, Chris Barker - NOAA Federal <<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>> wrote:<br>
>><br>
>> On Wed, Jun 12, 2013 at 5:10 AM, Nathaniel Smith <<a href="mailto:njs@pobox.com" target="_blank">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>
><br>
><br>
> I agree.</p>
</div><p dir="ltr">Sounds like we're pretty much reaching consensus. Phew.</p><div class="im">
<p dir="ltr">>><br>
>> ...<br>
>>  deprecate np.ma.filled<br>
><br>
><br>
> Please don't. Rather just live with the inconsistency between numpy and <a href="http://numpy.ma" target="_blank">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" target="_blank">numpy.ma</a> much less important:)</p>


</div><p dir="ltr">Oh, I do tell myself that :-). With my committer/consensus-building hat on, <a href="http://np.ma" target="_blank">np.ma</a> has users, so I want something they can live with, and was suggesting some options. For myself I don't really care what <a href="http://np.ma" target="_blank">np.ma</a> does though since I don't use it...</p>
<div class="im">

<p dir="ltr">>> 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>
>> +1<br>
>><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>
>> 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>
>> to the See Also section below).  The parameters given here refer to<br>
>> 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()...<br>
><br>
><br>
> I like np.filled as well. np.fill_with sounds fine too.</p>
</div><p dir="ltr">Grammatically, fill_with is an imperative, which suggests it needs an array to operate on; it's synonymous with just plain 'fill'. Having 'fill' and 'fill_with' as different functions with different semantics would be pretty confusing!</p>
<span class="HOEnZb"><font color="#888888">

<p dir="ltr"></p></font></span></blockquote><div><br></div><div>That's why I suggested 'filledwith' (add the underscore if you like).  This also allows a corresponding masked implementation, 'ma.filledwith', without clobbering the existing 'ma.filled'.<br>
<br></div><div>Warren<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><p dir="ltr">-n</p>
</font></span><br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div></div>