Skip to content

Instantly share code, notes, and snippets.

@otaviomguerra
Created July 29, 2018 01:50
Show Gist options
  • Save otaviomguerra/c937963b0f451356ea11cbf4fa2f20bf to your computer and use it in GitHub Desktop.
Save otaviomguerra/c937963b0f451356ea11cbf4fa2f20bf to your computer and use it in GitHub Desktop.
Replicate a given array randomly and compute a given function(mean, median, etc)
def bootstrap_replicate_1d(data, func):
return func(np.random.choice(data, size=len(data)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment