<div dir="ltr">Hello Nicolas,<div><br></div><div>the following code snippet from your game of life section</div><div><br></div><div><pre class="gmail-code gmail-python gmail-literal-block" style="font-size:15.3px;font-family:"source code pro",monospace;line-height:19.125px;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;background-color:rgb(252,252,252);border-top:0.5px solid rgb(204,204,204);border-bottom:0.5px solid rgb(204,204,204);padding-left:2em;padding-top:0.5em;padding-bottom:0.5em"><span class="gmail-name">birth</span> <span class="gmail-operator">=</span> <span class="gmail-punctuation">(</span><span class="gmail-name">N</span><span class="gmail-operator">==</span><span class="gmail-literal gmail-number gmail-integer">3</span><span class="gmail-punctuation">)</span> <span class="gmail-operator">&</span> <span class="gmail-punctuation">(</span><span class="gmail-name">Z</span><span class="gmail-punctuation">[</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">:</span><span class="gmail-operator">-</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">,</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">:</span><span class="gmail-operator">-</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">]</span><span class="gmail-operator">==</span><span class="gmail-literal gmail-number gmail-integer">0</span><span class="gmail-punctuation">)</span>
<span class="gmail-name">survive</span> <span class="gmail-operator">=</span> <span class="gmail-punctuation">((</span><span class="gmail-name">N</span><span class="gmail-operator">==</span><span class="gmail-literal gmail-number gmail-integer">2</span><span class="gmail-punctuation">)</span> <span class="gmail-operator">|</span> <span class="gmail-punctuation">(</span><span class="gmail-name">N</span><span class="gmail-operator">==</span><span class="gmail-literal gmail-number gmail-integer">3</span><span class="gmail-punctuation">))</span> <span class="gmail-operator">&</span> <span class="gmail-punctuation">(</span><span class="gmail-name">Z</span><span class="gmail-punctuation">[</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">:</span><span class="gmail-operator">-</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">,</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">:</span><span class="gmail-operator">-</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">]</span><span class="gmail-operator">==</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">)</span>
<span class="gmail-name">Z</span><span class="gmail-punctuation">[</span><span class="gmail-operator">...</span><span class="gmail-punctuation">]</span> <span class="gmail-operator">=</span> <span class="gmail-literal gmail-number gmail-integer">0</span>
<span class="gmail-name">Z</span><span class="gmail-punctuation">[</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">:</span><span class="gmail-operator">-</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">,</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">:</span><span class="gmail-operator">-</span><span class="gmail-literal gmail-number gmail-integer">1</span><span class="gmail-punctuation">][</span><span class="gmail-name">birth</span> <span class="gmail-operator">|</span> <span class="gmail-name">survive</span><span class="gmail-punctuation">]</span> <span class="gmail-operator">=</span> <span class="gmail-literal gmail-number gmail-integer">1</span></pre></div><div class="gmail_extra"><br></div><div class="gmail_extra">is incorrect. You need to add a [1:-1,1:-1] to both the places where you are comparing N to a number to ensure</div><div class="gmail_extra">the shapes are correct.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Joy</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 29, 2017 at 7:27 PM, Nicolas P. Rougier <span dir="ltr"><<a href="mailto:Nicolas.Rougier@inria.fr" target="_blank">Nicolas.Rougier@inria.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 29 Jan 2017, at 19:25, Glenn Nelson <<a href="mailto:kitecamguy@gmail.com">kitecamguy@gmail.com</a>> wrote:<br>
><br>
> I spent some time reading your book and give it 4 out of 4 stars! I use numpy often in my work, but have not delved into it enough to understand it at the level that you present. I will definitely spend more time with your book and I expect it will alter the way I use numpy.<br>
<br>
</span>Thank you.<br>
<span class=""><br>
> Your English is excellent, too.<br>
<br>
</span>Oh many thanks. Didn't expect this one :)<br>
<span class="HOEnZb"><font color="#888888"><br>
Nicolas<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> Thank you for sharing this.<br>
><br>
> ----<br>
> Glenn Nelson in Santa Cruz<br>
> social: <a href="http://google.com/+GlennNelson" rel="noreferrer" target="_blank">http://google.com/+GlennNelson</a><br>
> see my Kite Aerial Photos at <a href="http://www.glenn-nelson.us/kap" rel="noreferrer" target="_blank">http://www.glenn-nelson.us/kap</a><br>
><br>
> On Thu, Dec 22, 2016 at 8:44 AM, Nicolas P. Rougier <<a href="mailto:Nicolas.Rougier@inria.fr">Nicolas.Rougier@inria.fr</a>> wrote:<br>
><br>
> Dear all,<br>
><br>
> I've just put online a (kind of) book on Numpy and more specifically about vectorization methods. It's not yet finished, has not been reviewed and it's a bit rough around the edges. But I think there are some material that can be interesting. I'm specifically happy with the boids example that show a nice combination of numpy and matplotlib strengths.<br>
><br>
> Book is online at: <a href="http://www.labri.fr/perso/nrougier/from-python-to-numpy/" rel="noreferrer" target="_blank">http://www.labri.fr/perso/<wbr>nrougier/from-python-to-numpy/</a><br>
> Sources are available at: <a href="https://github.com/rougier/from-python-to-numpy" rel="noreferrer" target="_blank">https://github.com/rougier/<wbr>from-python-to-numpy</a><br>
><br>
><br>
> Comments/questions/fixes/ideas are of course welcome.<br>
><br>
><br>
> Nicolas<br>
> ______________________________<wbr>_________________<br>
> Matplotlib-users mailing list<br>
> <a href="mailto:Matplotlib-users@python.org">Matplotlib-users@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/matplotlib-<wbr>users</a><br>
><br>
<br>
______________________________<wbr>_________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/matplotlib-<wbr>users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">The best ruler, when he finishes his<br>tasks and completes his affairs,<br>the people say <br>“It all happened naturally”<br>                                       <br>                                         - Te Tao Ch'ing</div>
</div></div>