How to setup numpy in jython

后端 未结 1 1731
予麋鹿
予麋鹿 2021-01-02 09:54

There is a project called JyNI that allows you to run NumPy in Jython. However I haven\'t come across anywhere on how to get NumPy into Jython. I\'ve tried \'pip install nu

1条回答
  •  执笔经年
    2021-01-02 10:17

    JyNI does state NumPy-support as its main goal, but cannot do it yet, as long as it is still in alpha-state. However until it is mature enough you can use NumPy via

    • JEP (https://github.com/mrj0/jep) or
    • JPY (https://github.com/bcdev/jpy).

    Alternatively you can use a Java numerical library for your computation, e.g. one of these:

    • https://github.com/mikiobraun/jblas
    • https://github.com/fommil/matrix-toolkits-java

    Both are Java-libs that do numerical processing natively backed by blas or lapack (i.e. the same backends NumPy uses), so the performance should equal that of NumPy more or less. However they don't feature such a nice multiarray implementation as NumPy does afaik.

    If you need NumPy indirectly to fulfill dependencies of some other framework, these solutions won't do it out of the box. If the dependencies are only marginal you can maybe rewrite/substitute the corresponding calls based on one of the named projects. Otherwise you'll have to wait for JyNI...

    If you can make some framework running on Jython this way, please consider to make your work publicly available, ideally as a fork of the framework.

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