[Py4j-users] Passing list of list to java
Status: Beta
Brought to you by:
barthe
|
From: sudheera N. <sud...@gm...> - 2015-10-02 15:05:04
|
Hi
I need to pass a list of list , ex. [["A","B"],[1,2],[3,4]] to a java
program from python using Py4j and want to collect it from java side to a
String[][] array.
I can pass a simple list but list of list gives me following error.
=======================================================
DIgSI/err - Python Script 'PhdThesesPy' stopped at error
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "C:\Program Files (x86)\DIgSILENT\PowerFactory
15.1\python\PhdTheses.py", line 84, in <module>
repastCall_Demand(DemandData)
File "C:\Program Files (x86)\DIgSILENT\PowerFactory
15.1\python\PhdTheses.py", line 69, in repastCall_Demand
wd.setDemandFromPF(java_DemandData)
File "C:\Python33\lib\site-packages\py4j\java_gateway.py", line 804, in
__call__
[get_command_part(arg, self.pool) for arg in new_args])
File "C:\Python33\lib\site-packages\py4j\java_gateway.py", line 804, in
<listcomp>
[get_command_part(arg, self.pool) for arg in new_args])
File "C:\Python33\lib\site-packages\py4j\protocol.py", line 278, in
get_command_part
command_part = REFERENCE_TYPE + parameter._get_object_id()
AttributeError: 'list' object has no attribute '_get_object_id'
===========================================================
Thsanks
--
Sudheera Navaratne
|