<br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 10:36 AM, Pauli Virtanen <span dir="ltr"><<a href="mailto:pav@iki.fi" target="_blank">pav@iki.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
23.07.2013 19:22, Charles R Harris kirjoitti:<br>
[clip]<br>
<div class="im">> Grepping in my code, I find a lot of things like<br>
><br>
> dfx = van.dot((ax2 - ax1).flat)<br>
><br>
> IIRC, the flat version was faster than other methods.<br>
<br>
</div>That goes through the same code path as<br>
`van.dot(np.asarray((ax2 - ax1).flat))`, which calls the `__array__`<br>
attribute of the flatiter object. If it's faster than .ravel(), that is<br>
surprising.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br>Well, I never use ravel, there are zero examples in my code ;) So you may be correct.<br><br>I'm not sure the example I gave is the one where '*.flat' wins, but I recall such a case and have just used flat a lot ever since.<br>
<br>Chuck <br></div><br></div>