Skip to content

Instantly share code, notes, and snippets.

@anurlybayev
Created April 1, 2018 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anurlybayev/46812eb25a51e334b01e93fb8893d4b3 to your computer and use it in GitHub Desktop.
Save anurlybayev/46812eb25a51e334b01e93fb8893d4b3 to your computer and use it in GitHub Desktop.
numpy in Swift
import Python
let np = Python.import("numpy")
let x = np.array([6, 7, 8])
let y = np.arange(24).reshape(2, 3, 4)
let a = np.ones(3, dtype: np.int32)
let b = np.linspace(0, pi, 3)
let c = a+b
let d = np.exp(c)
print(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment