4 ms·
You mentioned it but, for those who don’t know: As a stopgap while all the data science tooling is being built out for Swift you can use anything from the Pyth
by yeldarb 7y ago
You mentioned it but, for those who don’t know:
As a stopgap while all the data science tooling is being built out for Swift you can use anything from the Python ecosystem (including np and pd) by using the Python interop:
let np = Python.import(“numpy”)
https://github.com/tensorflow/swift/blob/master/docs/PythonInteroperability.md https://github.com/tensorflow/swift/blob/master/docs/PythonI...
- mlevental 7y agohow does this work? does it actually compile/embed there python interpreter or does it make calls to the system interpreter somehow?
- mlevental 7y agoi just tried this out and i'm blown away that it works. even matplotlib. does anyone know how to point it at a different interpreter? a venv for example?
- wool_gather 7y agoFrom the linked document: > To accomplish this, the Swift script/program simply links the Python interpreter into its code. I would imagine that having the interpreter in another process would be a gigantice performance hit.
- mlevental 7y agoyea i realized it's the obvious thing: load the dll.