From Python to Numpy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

From Python to Numpy

Nicolas P. Rougier

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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Numpy-discussion] From Python to Numpy

Chris Barker - NOAA Federal
Nicolas,

From a quick glance, this looks really wonderful! I intend to point my students that are interested in numpy to it.

-CHB


On Thu, Dec 22, 2016 at 8:44 AM, Nicolas P. Rougier <[hidden email]> 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
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/numpy-discussion



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Numpy-discussion] From Python to Numpy

Kiko
In reply to this post by Nicolas P. Rougier


2016-12-22 17:44 GMT+01:00 Nicolas P. Rougier <[hidden email]>:

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.

Wow!!! Beautiful.

Thanks for sharing.
 


Nicolas
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/numpy-discussion


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Numpy-discussion] From Python to Numpy

Alex Rogozhnikov
Hi Nicolas, 
that's a very nice work!

Comments/questions/fixes/ideas are of course welcome.

Boids example brought my attention too, some comments on it:
- I find using complex numbers here very natural, this should speed up things and also shorten the code (rotating without einsum, etc.)
- you probably can speed up things with going to sparse arrays 
- and you can go to really large numbers of 'birds' if you combine it with preliminary splitting of space into squares, thus analyze only birds from close squares

Also I think worth adding some operations with HSV / HSL color spaces as those can be visualized easily e.g. on some photo.

Thanks,
Alex.



23 дек. 2016 г., в 12:14, Kiko <[hidden email]> написал(а):



2016-12-22 17:44 GMT+01:00 Nicolas P. Rougier <[hidden email]>:

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.

Wow!!! Beautiful.

Thanks for sharing.
 


Nicolas
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/numpy-discussion

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/numpy-discussion


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: From Python to Numpy

Glenn Nelson
In reply to this post by Nicolas P. Rougier
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. Your English is excellent, too.

Thank you for sharing this.

----
Glenn Nelson in Santa Cruz

On Thu, Dec 22, 2016 at 8:44 AM, Nicolas P. Rougier <[hidden email]> 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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: From Python to Numpy

Nicolas P. Rougier

> On 29 Jan 2017, at 19:25, Glenn Nelson <[hidden email]> 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 <[hidden email]> 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
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: From Python to Numpy

Joy merwin monteiro
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[...] = 0
Z[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 <[hidden email]> wrote:

> On 29 Jan 2017, at 19:25, Glenn Nelson <[hidden email]> 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 <[hidden email]> 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
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
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

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Loading...