1

Is it possible to use python "scipy" linear algebra library from spark/scala script?

I need to use the rich sparse functions in the "scipy" library but my project is already in scala

3
  • Unlikely. The scipy code is written in Python with heavy use of numpy. numpy has a lot of compiled code. So does the scipy.sparse. Some of the linear algrabra stuff uses external compiled libraries, ones can be used by other code. But that's a c/c++/Fortran task. Commented Nov 2, 2016 at 0:56
  • Maybe use pyspark for that part? Commented Nov 2, 2016 at 2:00
  • I think Breeze is the linear algebra package for Scala Commented Nov 2, 2016 at 3:34

2 Answers 2

1

It's not feasible to use SciPy from Scala, because Python is no JVM language, but there seem to be ways. The closest you might get in pure Scala is to use Scalanlp-Breeze. You can check out their Comparison with Matlab and Numpy. Their is a SparseMatrix datastructure, you should look at that.

Make sure you properly install the native libraries if you want to get the full performance.

Sign up to request clarification or add additional context in comments.

Comments

0

I think it is not possible to use scipy if you want to take the concurrent computing advantage of spark, because scipy is not designed for spark.

If you only want to use it in a local machine in scala script, you can try java-python-integration. Or you can use scipy-like lib in Java instead.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.