Exemple #1
0
 def pass_python_data_to_prepared_script(
         self, sds, var_name: str, prepared_script: JavaObject) -> None:
     assert self.is_python_local_data, 'Can only pass data to prepared script if it is python local!'
     if self._is_numpy():
         prepared_script.setMatrix(var_name,
                                   numpy_to_matrix_block(
                                       sds, self._np_array),
                                   True)  # True for reuse
 def convert_back_and_forth(self, array):
     matrix_block = numpy_to_matrix_block(self.jvm, array)
     # use the ability to call functions on matrix_block.
     returned = matrix_block_to_numpy(self.jvm, matrix_block)
     self.assertTrue(np.allclose(array, returned))