Pandas dataframe convert to Array

This hack should let you automatically convert to Array without type piracy, but @nilshg 's answer may be the most idiomatic solution.

using Pandas
using Plots: Plots
plot(args...; kw...) = Plots.plot(Array.(args)...; kw...)
plot!(args...; kw...) = Plots.plot!(Array.(args)...; kw...)

df = read_table("M.out/table.txt")

x = df["# t (s)"]

plot(x,  df["mx ()"])
plot!(x, df["my ()"])
plot!(x, df["mz ()"])

plot(1:10, sin.(1:10), title="normal usage still works")
1 Like