joelgrus / data-science-from-scratch

code for Data Science From Scratch book
MIT License
8.71k stars 4.52k forks source link

Fix gradient descent example for Python 3 #24

Closed naoyak closed 1 day ago

naoyak commented 8 years ago

The example producing Figure 8-3 in the book doesn't work in Python 3, apparently because the iterator returned by map() doesn't work with pyplot, so using a list comprehension here instead.

daun-io commented 7 years ago

I was finding the way to fix this by including map into list which is absolutely working but not an efficient idea. Thank you for suggesting me a better way :)

brettmendes87 commented 6 years ago

Just wanted to say thank you to naoyak! This one really had me scratching my head when I first encountered it.