rougier / from-python-to-numpy

An open-access book on numpy vectorization techniques, Nicolas P. Rougier, 2017
http://www.labri.fr/perso/nrougier/from-python-to-numpy
Other
2.05k stars 340 forks source link

meshgrid is not explained - very important for 3D plots and algorithms #65

Closed den-run-ai closed 6 years ago

den-run-ai commented 7 years ago

2 of your exercises use this function:

http://www.labri.fr/perso/nrougier/teaching/numpy.100/index.html

rougier commented 7 years ago

Can you give somemore details ?

den-run-ai commented 7 years ago

There is one example for contour plot in numpy docs:

https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.meshgrid.html#numpy.meshgrid

On Fri, Sep 29, 2017, 1:17 AM Nicolas P. Rougier notifications@github.com wrote:

Can you give somemore details ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rougier/from-python-to-numpy/issues/65#issuecomment-333040568, or mute the thread https://github.com/notifications/unsubscribe-auth/AHgZ5Y-DkJksqs-XG495ljLPOD-zd_wCks5snItwgaJpZM4PoMtH .

rougier commented 7 years ago

Thanks. My question was rather what was your solution to include meshgrid in the book. Do you think there some section where it would fit? (Note I did not include everything in the book).

makmanalp commented 7 years ago

Also handy for parametric plots!

den-run-ai commented 7 years ago

I think somewhere between reshaping and broadcasting would be a good fit:

http://www.labri.fr/perso/nrougier/from-python-to-numpy/#reshaping

On Mon, Oct 2, 2017, 4:14 PM makmanalp notifications@github.com wrote:

Also handy for parametric plots!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rougier/from-python-to-numpy/issues/65#issuecomment-333667189, or mute the thread https://github.com/notifications/unsubscribe-auth/AHgZ5ePsKr_sZnOhcN_s2VpoYUbkllQnks5soVIogaJpZM4PoMtH .

makmanalp commented 7 years ago

Or perhaps creation? In my mind it's a bit like diag or triu in that you give it some numbers to create more complex matrices.

rougier commented 7 years ago

Does anyone want to propose a PR ?