-
If I have a Julia function that looks like the following: I've tried Got an error like the following: "...expected AbstractVector{<:AbstractVector{<:Real}}, got a value of type PyArray{Int64, 2, true, false, Int64}..." @cjdoris I will note I found this thread and I did get your option 4 working. But I was hoping I could get something along the lines of your option 1 working. Note that for situations where my input is a vector I've been successful, where I've failed is a vector of vectors. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
AFAIR You could just have a list I think you'll need to do some manual conversion using |
Beta Was this translation helpful? Give feedback.
-
Thanks. For anybody who might be reading this, the following is basically what I did: |
Beta Was this translation helpful? Give feedback.
AFAIR
np.array([np.array([1,2,3])])
is actually a matrix, not a vector of vectors. There are no conversions in PythonCall from a matrix to a vector of vectors, so you'll need to make it a vector of vectors yourself.You could just have a list
[np.array([1,2,3])]
or donp.array([np.array([1,2,3])], dtype=object)
. However neither of these will convert to aAbstractVector{<:AbstractVector{<:Real}}
because now the type of the elements of the given list or array cannot be inferred (the element type is just object).I think you'll need to do some manual conversion using
juliacall.convert
or do the conversion Julia-side.