Created
January 16, 2017 22:08
-
-
Save akhalsa/f69f6a111be81d55cff341eec0204af4 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 | |
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