Using py4j to send matrices to from Python to Java as int[][] arrays
问题 I've been using py4j to build a user-friendly Python library around a less user-friendly Java library. For the most part, this has been a breeze, and py4j has been a great tool. However, I've come across a snag when sending matrices between Python and Java. Specifically, I have a static function in java that accepts, as its arguments, an integer matrix: public class MyClass { // ... public static MyObject create(int[][] matrix) { // ... } } I'd like to be able to call this from Py4j like so: