Digital Analog for Jython

I am considering porting scientific code from Python to Jython, and I wonder if there are math libraries for Jython that are:

  • free for commercial use
  • have convenient matrix syntax intended for Jython - for example, slicing, binary and integer indexing, + - * / operations like matlab and numpy.

The additional availability of machine learning and statistical routes will be a plus (or simply convertibility of the data to some common data format, understood by large Java machine learning libraries).

Thanks in advance for any information on such libraries.

+4
source share
1 answer

I took on the role of supporting such a package some time ago. It is called jnumeric (available on github and installed via maven ).

JNumeric has a strange history, though, dating back to the early 2000s. It was never functionally equivalent to NumPy (or even the numeric one that it was actually trying to emulate), and although it was "good enough" for what we used it to use it as a main number-cruncher in Java- the program is probably not a good idea. It was a pretty bad idea that we rewrote our application from scratch in Python so that we could use NumPy instead of trying to do vector math in Java. For this reason, jnumeric is underutilized and probably should gradually disappear into oblivion.

I recently noticed that a new project appeared on Github, Numpy4J , which may have a brighter future.

Although I know this is not entirely relevant to your question, I am curious why you would like to switch to Jython for scientific code. Java does not have the beautiful number of crunch and print libraries that Python has. ML libraries like Weka have Python equivalents in scikit-learn. Images such as ImageJ have an equivalent in scikit image. Statistical packages exist in pandas and statistical models. What is your scientific itch that Python doesn't scratch?

If you want to switch to Jython to interact with an existing Java library that cannot be easily ported to Python, I would consider JPype and not Jython.

+5
source

Source: https://habr.com/ru/post/1502443/


All Articles