Created
June 3, 2022 18:18
-
-
Save GitHubEmploy/81acce196e15c2adf1d62f922da301ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
rscores = np.random.randint(1, 100, size=100000010) | |
s = time.time() | |
cfailed = 0 | |
sfailed = 0 | |
for score in rscores: | |
if score < 70: | |
sfailed += score | |
cfailed += 1 | |
print(sfailed/cfailed) | |
print(f'For Loop: {time.time() - s} seconds') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment