Created
January 16, 2017 22:08
-
-
Save akhalsa/b59a67d230c3a7b0a03c85d59686eaaf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 numpy as np | |
def expSum(items): | |
temp = np.copy(items) | |
for x in np.nditer(temp, op_flags=['readwrite']): | |
x[...] = np.exp( x) | |
print "Using nditer and loop" | |
print temp | |
for row in items | |
print row | |
print "transpose" | |
for column in items.T: | |
print "column" | |
print column | |
x = np.arange(1, 6, 2) | |
scores = np.vstack([x, np.ones_like(x), 0.2 * np.ones_like(x)]) | |
print scores | |
expSum(scores) | |
x = np.array((9,5,8,6,4,11)).reshape(3,2) | |
print x | |
print x.min(axis=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment