[Matplotlib-users] From Python to Numpy

Joy merwin monteiro joy.merwin at gmail.com
Mon Jan 30 11:52:14 EST 2017


Hello Nicolas,

the following code snippet from your game of life section

birth = (N==3) & (Z[1:-1,1:-1]==0)survive = ((N==2) | (N==3)) &
(Z[1:-1,1:-1]==1)Z[...] = 0Z[1:-1,1:-1][birth | survive] = 1


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
the shapes are correct.

Joy

On Sun, Jan 29, 2017 at 7:27 PM, Nicolas P. Rougier <
Nicolas.Rougier at inria.fr> wrote:

>
> > On 29 Jan 2017, at 19:25, Glenn Nelson <kitecamguy at gmail.com> wrote:
> >
> > 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.
>
> Thank you.
>
> > Your English is excellent, too.
>
> Oh many thanks. Didn't expect this one :)
>
> Nicolas
>
> >
> > Thank you for sharing this.
> >
> > ----
> > Glenn Nelson in Santa Cruz
> > social: http://google.com/+GlennNelson
> > see my Kite Aerial Photos at http://www.glenn-nelson.us/kap
> >
> > On Thu, Dec 22, 2016 at 8:44 AM, Nicolas P. Rougier <
> Nicolas.Rougier at inria.fr> wrote:
> >
> > Dear all,
> >
> > 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.
> >
> > Book is online at: http://www.labri.fr/perso/
> nrougier/from-python-to-numpy/
> > Sources are available at: https://github.com/rougier/
> from-python-to-numpy
> >
> >
> > Comments/questions/fixes/ideas are of course welcome.
> >
> >
> > Nicolas
> > _______________________________________________
> > Matplotlib-users mailing list
> > Matplotlib-users at python.org
> > https://mail.python.org/mailman/listinfo/matplotlib-users
> >
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>



-- 
The best ruler, when he finishes his
tasks and completes his affairs,
the people say
“It all happened naturally”

                                         - Te Tao Ch'ing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170130/3f61a87c/attachment.html>


More information about the Matplotlib-users mailing list