AllenDowney / ThinkStats2

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

#179 Fix - deprecated type passed to `np.linspace` #191

Closed IlIllII closed 2 years ago

IlIllII commented 2 years ago

Original notebook throws the following warning from InterpolateSample:

/home/downey/anaconda3/envs/ModSimPy/lib/python3.6/site-packages/ipykernel_launcher.py:26: DeprecationWarning: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

Looks like this is fully deprecated in new versions, breaking the notebook. Casting row.freq to an int fixes the issue. Cells afterward then work as intended.

Should row.freq be rounded instead of truncated? I don't think so but I leave that decision to the experts.

AllenDowney commented 2 years ago

I think truncation is ok, but I will double check.