Skip to content

Instantly share code, notes, and snippets.

@eddiebergman
Created February 6, 2023 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddiebergman/f2424ccbd37d90d815e727a0ad708bfa to your computer and use it in GitHub Desktop.
Save eddiebergman/f2424ccbd37d90d815e727a0ad708bfa to your computer and use it in GitHub Desktop.
Case for not using `np.random.seed`
import numpy as np
np.random.seed(1)
print("My code", np.random.choice([1,2,3,4,5]))
# My code 4
# Update library
np.random.seed(1)
# Library adds in a new bit of randomness
print("Updated library", np.random.choice([1,2,3,4,5])
# Updated library 4
print("My code", np.random.choice([1,2,3,4,5]))
# My code 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment