-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Missing and missing are first class types/values in Julia Base. PythonPlot should simply not plot missing data. It errors in PythonPlot.
julia> plot([1, missing, 2])
ERROR: Python: ValueError: setting an array element with a sequence.Here is a type translation inspired by one that works for PyCall (JuliaPy/PyPlot.jl#593):
using PythonPlot
using PythonCall
"Recast julia Arrays with missing as python masked arrays."
function PythonCall.Py(a::Array{Union{T,Missing},N}) where {T,N}
np = PythonCall.pyimport("numpy")
np.ma.masked_invalid(np.array(replace(a, missing => NaN)))
end
# test
plot([1,2,missing,4,5], marker="o")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels