Can I run numpy and pandas with Jython

后端 未结 4 684
迷失自我
迷失自我 2020-12-01 21:10

We have some Java code we want to use with new code we plan to write in Python, hence our interest in using Jython. However we also want to use numpy and pandas libraries to

相关标签:
4条回答
  • 2020-12-01 21:57

    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 once it is mature. However, it is not yet capable to import Numpy.

    Until then you can use Numpy from Java by embedding CPython. See the Numpy4J-project for this (I didn't test it myself though).

    0 讨论(0)
  • 2020-12-01 21:59

    Not directly.

    One option which I've used in the past is to use jsonrpclib (which works for both) to communicate between python and jython. There's even a server builtin which makes things quite simple. You'll just need to figure out whether the gains of using numpy are worth the additional overhead.

    0 讨论(0)
  • 2020-12-01 22:14

    You can't use numpy from Jython at this time. But if you're willing to use CPython instead of Jython, there are some open source Java projects that work with numpy (and presumably pandas).

    • Jep
    • jpy
    • JyNI
    0 讨论(0)
  • 2020-12-01 22:15

    Keep an eye in JyNI which is at alpha.2 version, as of March-2014.

    0 讨论(0)
提交回复
热议问题