From CSV to Circular Array

I’m storing matrices as CSV files that are meant to be read as circular arrays. When I creat a scrip to analysis the data I use CSV.red(..., DataFrame(...)) to read this files and the Matrix() to be analyze the data. However, the data is meant to be read as a CircularArray, from the package CircularArrays.jl is there a way to read this file as such?

I’m not familiar with CircularArrays.jl, and I’m on a very restricted terminal now. I assume that you are able to provide the CircularArray constructor with a Matrix from the DataFrame?

The constructor you want is likely:

CircularArray(data::AbstractArray{T, N}) where {T, N}

i.e.


julia> using CircularArrays
julia> a = [1 2; 3 4];
julia> b = CircularArray(a)
2×2 CircularArray(::Matrix{Int64}):
 1  2
 3  4

julia> b[3, 3]
1