Jackknife algorithm implemented in Python