Created
February 12, 2020 06:20
-
-
Save arpit-omprakash/4a1d9fa225772ab3c4b4080ba013baa9 to your computer and use it in GitHub Desktop.
Example of PyCall library in Julia
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
module MyModule | |
using PyCall | |
function __init__() | |
py """ | |
import numpy as np | |
def one(x): | |
return np.sin(x) ** 2 + np.cos(x) ** 2 | |
""" | |
end | |
two(x) = py"one"(x) + py"one"(x) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment