Re: [Py4j-users] Converting Python collections to Java Collections
Status: Beta
Brought to you by:
barthe
From: Barthelemy D. <bar...@in...> - 2014-08-19 09:51:04
|
Hi, Thanks for using Py4j! Py4J supports automated conversion to Java lists, sets, and maps, but not array: http://py4j.sourceforge.net/advanced_topics.html#converting-python-collections-to-java-collections You can still create an array from Py4J using gateway.new_array (http://py4j.sourceforge.net/faq.html#how-to-create-an-array). If you want Py4J to support automated conversion to Java arrays, you can open an issue on github with an example of your use case. There are a few challenges with automatically converting to Java collections and to Java arrays in particular, but it might be possible to create a converter for common cases. Cheers, Barthelemy On Mon, Aug 18, 2014 at 10:57 PM, Mingda Zhang <sd...@16...> wrote: > Hi, > Py4J is a great project to access Java objects. Py4J can covert Python > collections to Java collections easily. But now, I need to convert the > Python collections to Java array (The Input parameters of methods in Java > are array ). Could anyone tell me how to do this with Py4J? Thank you very > much. > Best regards, > Mingda Zhang > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Py4j-users mailing list > Py4...@li... > https://lists.sourceforge.net/lists/listinfo/py4j-users > |