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.03k stars 339 forks source link

Chapter 4.2: Uniform vectorization - NameError: name 'shape' is not defined #114

Closed sc0v0ne closed 6 months ago

sc0v0ne commented 6 months ago

Good morning I'm studied From Python to Numpy. I was testing to the codes as I read. I ended up finding a mistake.

Error: image

I solve the error by adding shape, I don't know if it follows the correct logic following the book. If it's wrong, please correct me.

Solution: image

Thanks for your attention have great day.

rougier commented 6 months ago

Thanks for the report. I'm not sure which part of the book you extract the code but if Z is a numpy array, I should have wrote Z.shape instead of shape. Else (Z is a list of list), your solution looks good. Can you make a PR?

sc0v0ne commented 6 months ago

Yes, I can.

sc0v0ne commented 6 months ago

I can see that the code is updated, but it is not on the website. Can I update the website? or would this be an admin execution of github actions ?

image

sc0v0ne commented 6 months ago

115 It has already been resolved, I looked at the history. Just the website itself, which still has old code.

rougier commented 6 months ago

I4ve just updated the website.

sc0v0ne commented 6 months ago

@rougier Thanks.