Skip to content

Instantly share code, notes, and snippets.

@wimglenn
Created June 26, 2018 20:10
Show Gist options
  • Save wimglenn/fb4e4c04c067d6d566f7f2ca023bdd2a to your computer and use it in GitHub Desktop.
Save wimglenn/fb4e4c04c067d6d566f7f2ca023bdd2a to your computer and use it in GitHub Desktop.
numpy wat
>>> import numpy as np
>>> import builtins
>>> np.random.randn(3,3)
array([[-0.24401213, -0.19773938, 0.47278806],
[-0.6083566 , -0.65160561, 0.78145811],
[ 0.14546934, -0.86849935, 2.07570471]])
>>> np.empty((3,3)) # sign loss
array([[0.24401213, 0.19773938, 0.47278806],
[0.6083566 , 0.65160561, 0.78145811],
[0.14546934, 0.86849935, 2.07570471]])
>>> np.random.randn(3,3)
array([[ 0.16574423, -0.46423738, 0.03250756],
[ 1.73511269, 1.32196368, -0.10191454],
[-1.10077353, -0.12643854, 1.29953623]])
>>> del builtins._
>>> np.empty((3,3)) # no sign loss
array([[ 0.16574423, -0.46423738, 0.03250756],
[ 1.73511269, 1.32196368, -0.10191454],
[-1.10077353, -0.12643854, 1.29953623]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment