Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy to array conversion #28

Closed
desertfrog opened this issue Apr 10, 2018 · 1 comment
Closed

Numpy to array conversion #28

desertfrog opened this issue Apr 10, 2018 · 1 comment
Assignees

Comments

@desertfrog
Copy link

Numpy arrays of are not being properly handled and converted into java arrays when passed to a constructor, resulting in a "No matching overloads found" error. Small example code and java class is below:

import numpy as np
arr = np.arange(0, 10, dtype=np.int32)
n2a = Numpy2Array(arr)
Traceback (most recent call last):

  File "<ipython-input-11-b39ee7ec0b3b>", line 1, in <module>
    n2a = Numpy2Array(arr)

  File "/Users/monterial1/anaconda3/lib/python3.6/site-packages/JPype1-0.6.3-py3.6-macosx-10.7-x86_64.egg/jpype/_jclass.py", line 111, in _javaInit
    *args)

RuntimeError: No matching overloads found for [init in find. at native/common/jp_method.cpp:127

And the java class is:

public class Numpy2Array
{

  private int[] data = null;
  
  public Numpy2Array(int[] data)
  {
    this.data = data;
  }
  
  public void PrintArray()
  {
    for (int i = 0; i < this.data.length; i++)
    {
      System.out.println(this.data[i]);
    }
  }
}

@Thrameos Thrameos self-assigned this Jul 11, 2018
@Thrameos
Copy link
Owner

Is this one still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants