Skip to content

Java arrays passed to python script can't be passed to pandas.DataFrame #306

Description

@sayan-sen

I have a double array in java. When i print the array it shows like:
[6.390933837890625, 6.412708740234375, 6.383675537109375, 6.398192138671875, 6.40907958984375, 6.40907958984375, 6.416337890625, 6.4054504394531255, 6.40907958984375.....]

I pass it as arg to a python script func:

Python py = Python.getInstance();
PyObject pyObject=py.getModule("test");
pyObject.callAttr("showArr",darr);

Where my test.py is:

def showArr(arr):
	print(arr)

in python o/p it shows:
jarray('D')([6.390933837890625, 6.412708740234375, 6.383675537109375, 6.398192138671875, .......])

Because of this am not being able to call pandas.DataFrame(arr)
When i print a simple array in python it prints fine:

>>> arr=[1,2,3]
>>> print(arr)
[1, 2, 3]

Why does this jarray('D') gets prepended when i pass the double array to the py script?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions