TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

From Python to Numpy

348 pointsby haraballover 8 years ago

12 comments

grejover 8 years ago
As someone who has used numpy for many years and written a great deal of production code using it, I was surprised when I read through this and saw some numpy tricks that I didn&#x27;t know regarding the speeds of various operations! This is really a fantastic reference that provides a deeper level of understanding of what numpy does under the hood.<p>One thing I will highlight that the author just touched on briefly, is that numpy combined with numba is really a phenomenal combination for dealing with very computationally intensive problems.<p>The folks at Continuum Analytics have really done a fantastic job building numba (numba.pydata.org), which JIT compiles a subset of python functions using LLVM, and is designed to work seamlessly with numpy arrays. Numba makes it much easier to speed up performance bottlenecks and allows you to easily create numpy ufuncs which can take advantage of array broadcasting.
评论 #13360483 未加载
评论 #13357701 未加载
评论 #13357843 未加载
评论 #13360485 未加载
dansoover 8 years ago
Immediately recognized the domain name. Months ago I was doing yet another search on how to do geospatial plotting with Matplotlib, the kind that mostly works-out-of-the-box in R&#x2F;ggplot2, but, because of some latent fragmentation from Py2v3, was not well-documented anywhere in Python&#x2F;matplotlib. And while I&#x27;ve come to really like and respect Matplotlib, the documented examples stray far from what they should for purposes of API illustration, and so learning it has been a test in patience.<p>Anyway, Mr. Rougier&#x27;s Matplotlib was both informative, concise, and beautiful. Actually, I think my appreciation for matplotlib came from reading his guide: <a href="https:&#x2F;&#x2F;www.labri.fr&#x2F;perso&#x2F;nrougier&#x2F;teaching&#x2F;matplotlib&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.labri.fr&#x2F;perso&#x2F;nrougier&#x2F;teaching&#x2F;matplotlib&#x2F;</a>
masnickover 8 years ago
The site is down for me, but you can see the content nicely formatted on GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;rougier&#x2F;from-python-to-numpy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rougier&#x2F;from-python-to-numpy</a><p>For cmd-f: mirror
评论 #13357969 未加载
mmmBaconover 8 years ago
I&#x27;d be very curious to know if there is any impact to choosing Numpy C ordered arrays or Fortran ordered arrays. As a long time Matlab user (since 1993) who moved to Python 3 years ago, I have always defaulted to Fortran order because it was what I was used to and seemed more intuitive. I did play with C ordered arrays but didn&#x27;t find an advantage in my limited investigation.
评论 #13379760 未加载
评论 #13360545 未加载
syntaxingover 8 years ago
Does anyone have a recommendation for something similar to this but for Python itself? I have been trying to find something that is not necessarily an intro or crash course book but a book with tips, great explanations, and neat examples (which this e-book(?)&#x2F;site has).<p>I see that the author has responded to a couple comments here. Thank you for your great work! It&#x27;s always great to have a nice reference material with concise examples. I think this will be helpful to everyone(beginners and advanced python users alike)!
评论 #13357389 未加载
评论 #13357768 未加载
评论 #13359032 未加载
评论 #13360119 未加载
评论 #13362719 未加载
评论 #13359678 未加载
jajoolover 8 years ago
this book is amazing! specially the authors sense of humor makes reading it fun.<p>&gt; For example, can you tell what the two functions below are doing? Probably you can tell for the first one, but unlikely for the second (or your name is Jaime Fernández del Río and you don&#x27;t need to read this book).
tu7001over 8 years ago
I just check the first example from introduction to vectorization: <a href="http:&#x2F;&#x2F;www.labri.fr&#x2F;perso&#x2F;nrougier&#x2F;from-python-to-numpy&#x2F;#id5" rel="nofollow">http:&#x2F;&#x2F;www.labri.fr&#x2F;perso&#x2F;nrougier&#x2F;from-python-to-numpy&#x2F;#id5</a>, (add_python and add_numpy) and benchmark results are nearly the same: 75.4ns and 77.7ns accordingly.
zellynover 8 years ago
Anyone (author) know what was used to generate the cover image of cubes and shadows?<p>Edit: it&#x27;s sketchup - there&#x27;s a .skp file in the data&#x2F; subdirectory of the github repo for the book.
haydover 8 years ago
Is there an epub&#x2F;mobi version?
BanzaiTokyoover 8 years ago
Does the book exist in PDF?
评论 #13357159 未加载
评论 #13357488 未加载
guitarbillover 8 years ago
&gt; be warned that I&#x27;m a bit picky about typography &amp; design: Edward Tufte is my hero<p>And it shows, the theme is beautiful. Also some of the best ASCII diagrams I&#x27;ve seen. Worth a look at the source, even if you don&#x27;t care about Python.
评论 #13357299 未加载
评论 #13355972 未加载
评论 #13356705 未加载
gerfficiencyover 8 years ago
I really appreciated the problem vectorization chapter. New approaches require new thinking and this is often forgotten when teaching new concepts.