AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.03k stars 11.31k forks source link

QUESTION: Why not use panda's histogram function? #69

Closed MikeTheGreat closed 2 years ago

MikeTheGreat commented 7 years ago

(First - is filing an issue like this an OK way to ask a question? If not I'll happily retract/delete it and/or please close it :) )

Second - this is book is excellent - thank you for sharing it!!

I'm working my way through your book and I've got a question: I notice that you've created your own ThinkStats2.Hist class. I dug around a bit and it looks like pandas has it's own hist method (http://pandas.pydata.org/pandas-docs/stable/visualization.html#histograms). I haven't tried it (yet), but i was wondering if there was a particular reason why you used your own class instead of the one built into Pandas?

AllenDowney commented 2 years ago

Sorry I didn't respond to this for so long!

The Pandas histogram function chooses bin sizes automatically, which is often useful, but not what I wanted for this book, where I want the Hist and Pmf objects to keep track of the set of unique values, not put them in bins.

Thanks for your kind words!