Last active
July 21, 2017 05:30
-
-
Save hatappi/efdd4a79bfe2ada0712fe4028e9892c1 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
require 'pycall/import' | |
include PyCall::Import | |
pyimport 'numpy', as: :np | |
x = np.matrix.([[1,2], [3, 4]]) | |
# => matrix([[1, 2], | |
# [3, 4]]) | |
y = np.matrix.([[5,6], [7, 8]]) | |
# => matrix([[5, 6], | |
# [7, 8]]) | |
z = x * y | |
# => matrix([[19, 22], | |
# [43, 50]]) | |
z.max.() | |
# => 50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment