Type conversion

After reading an arrow file I get the following type:

julia> sl.heading
200-element Arrow.Primitive{Float32, Vector{Float32}}:
 -0.0023596277
 -0.004771689
 -0.0052604624
  ā‹®
 -0.31095406
 -0.33066812
 -0.338615

If I want to plot it using PyPlot I need to apply collect, which is bad because it allocates.

Is there a way to convert this into a type that PyPlot.jl can handle without copying?

Try this:

heading = sl.heading.data

and then use heading in your PyPlot call.

1 Like