<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 28, 2014 at 9:41 AM, Ron Adam <span dir="ltr"><<a href="mailto:ron3200@gmail.com" target="_blank">ron3200@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":1zy" class="" style="overflow:hidden">>>> y = np.zeros((2, 3, 4))<br>
>>> y.shape<br>
(2, 3, 4)<br>
<br>
(Without the e.) I'm not sure if it's a good idea to use zeros with a different signature.</div></blockquote></div><br>np.zeros() can be called with an integer (length) argument as well:</div><div class="gmail_extra">
<br></div><div class="gmail_extra"><div class="gmail_extra">>>> np.zeros(3)</div><div class="gmail_extra">array([ 0., 0., 0.])</div><div class="gmail_extra"><br></div><div class="gmail_extra">To be completely analogous to the proposed bytes constructor, you would have to specify the data type, though:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">>>> np.zeros(3, 'B')</div><div class="gmail_extra">array([0, 0, 0], dtype=uint8)</div><div class="gmail_extra"><br></div><div class="gmail_extra">
+1 for bytes.zeros(n)</div></div><div class="gmail_extra"><br></div></div>