Can use Jython Python libraries

Can I run Nummy and Pandas with Jython - Python, Numpy, Pandas, Jython

We have Java code that we want to use with newCode that we want to write in Python, hence our interest in using Jython. However, we would also like to use Numpy and Pandas libraries to do complex statistical analysis on this Python code.

Can you call Numpy and Pandas from Jython?


5 for the answer № 1

Keep an eye on JyNI what's up with alpha.2 version, as of March 2014.

4 for the answer № 2

Not directly.

One option I've used in the past is to use Jsonrpclib (which works for both) to communicate between Python and Jython. There's even a built-in server that makes things pretty easy. You just need to find out if the benefits of using numpy are worth the extra effort.

2 for the answer № 3

Especially if you don't want to use raw Numpy, but other Python frameworks that depend on it, JyNI will be the way to go when it's ripe. However, it is not yet possible to import Numpy.

Until then, you can use Numpy from Java by embedding CPython. See the Numpy4J project for this (although I haven't tested it myself).

0 for the answer № 4

You cannot currently use "numpy" from Jython. However, if you want to use CPython instead of Jython, there are some open source Java projects that work with "numpy" (and presumably pandas).