TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

From Python to Numpy

348 点作者 haraball超过 8 年前

12 条评论

grej超过 8 年前
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 未加载
danso超过 8 年前
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>
masnick超过 8 年前
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 未加载
mmmBacon超过 8 年前
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 未加载
syntaxing超过 8 年前
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 未加载
jajool超过 8 年前
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).
tu7001超过 8 年前
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.
zellyn超过 8 年前
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.
hayd超过 8 年前
Is there an epub&#x2F;mobi version?
BanzaiTokyo超过 8 年前
Does the book exist in PDF?
评论 #13357159 未加载
评论 #13357488 未加载
guitarbill超过 8 年前
&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 未加载
gerfficiency超过 8 年前
I really appreciated the problem vectorization chapter. New approaches require new thinking and this is often forgotten when teaching new concepts.