joelgrus / data-science-from-scratch

code for Data Science From Scratch book
MIT License
8.63k stars 4.5k forks source link

Chapter 8: Map needs converted to list to plot #53

Open Ben-Downes opened 6 years ago

Ben-Downes commented 6 years ago

Looks like in python 3 they changed maps to be non-iterables so the code needs to look like: plt.plot(x, list(map(derivative_estimate, x)), 'b+')

Ben-Downes commented 6 years ago

for chapter 10: def plot_histogram(points, bucket_size, title=""): histogram = make_histogram(points, bucket_size) plt.bar(list(histogram.keys()), list(histogram.values()), width=bucket_size) plt.title(title) plt.show()