# From CSV to Circular Array

**URL:** <https://discourse.julialang.org/t/from-csv-to-circular-array/100051>\
**Category:** General Usage\
**Tags:** package, array, dataframes\
**Created:** [June 8, 2023, 1:55pm UTC](https://discourse.julialang.org/t/from-csv-to-circular-array/100051 "2023-06-08T13:55:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greivin](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@greivin](https://discourse.julialang.org/u/greivin)\
**Post date:** [June 8, 2023, 1:55pm UTC](https://discourse.julialang.org/t/from-csv-to-circular-array/100051/1 "2023-06-08T13:55:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)\
**Post date:** [June 8, 2023, 5:52pm UTC](https://discourse.julialang.org/t/from-csv-to-circular-array/100051/2 "2023-06-08T17:52:20Z")

</div>

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:

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

```

i.e.

```julia

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

```
