Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save juanmirocks/e4e60f8e6896118631147839005d31f6 to your computer and use it in GitHub Desktop.
Save juanmirocks/e4e60f8e6896118631147839005d31f6 to your computer and use it in GitHub Desktop.
import numpy as np
from numpy import random as rng
samples = rng.random(500000)
prices = (np.array([10, 20, 30, 40]) * 1000).reshape(4, 1)
f = np.vectorize(lambda x: x * 10)
final = f(samples) * prices
means = final.mean(1)
print(means, np.argmax(means))
print(final.std(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment