ERROR: LoadError: MethodError: no method matching isnan(::Py)

What package does the Py type come from? That’s probably the most important thing here — and it’d be good for you to understand why that’s the important thing.

You’re shuttling things back and forth between the two languages with one of the python interop packages. Thinking about just this one issue in isolation will likely just get you to the next section of code — which is exactly what happened with your previous question.

Instead of looking at these errors one-by-one, I’d encourage you to try to holistically dig into the conversion rules between the two languages in PythonCall.jl (I think that’s what you’re using) — and ask questions about the grand scheme!

3 Likes