resampling-stats / resampling-with

Source repository for third edition of "Resampling: The New Statistics"
https://resampling-stats.github.io
Other
13 stars 9 forks source link

Line missing in python ambulances example #143

Closed iusgit closed 1 year ago

iusgit commented 1 year ago

Hi,

just tested the ambulance.ipynb notebook and got an error, because the variable rnd is not defined. The line

rnd = np.random.default_rng()

is missing.

See https://github.com/resampling-stats/resampling-with/blob/1adf56fce57603e38661c5131ae9da777e6ced1e/source/resampling_method.Rmd#L620

matthew-brett commented 1 year ago

It works for me - rnd is defined at https://github.com/resampling-stats/resampling-with/blob/1adf56fce57603e38661c5131ae9da777e6ced1e/source/resampling_method.Rmd#L286 - is it possible you ran the cells out of order?

iusgit commented 1 year ago

Yes, but it is said (https://github.com/resampling-stats/resampling-with/blob/1adf56fce57603e38661c5131ae9da777e6ced1e/source/resampling_method.Rmd#L615C30-L616C14): "Here is the whole solution to the problem, without the comments:".

In my opinion it should run without prior commands...

matthew-brett commented 1 year ago

Yes, that's fair enough - we do import Numpy there as well. I've changed that in commit 795b125