# Plots borking on SentinelArrays produced by CSV.read

**URL:** <https://discourse.julialang.org/t/plots-borking-on-sentinelarrays-produced-by-csv-read/89505>\
**Category:** General Usage\
**Tags:** csv, plots\
**Created:** [October 30, 2022, 12:11am UTC](https://discourse.julialang.org/t/plots-borking-on-sentinelarrays-produced-by-csv-read/89505 "2022-10-30T00:11:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [October 30, 2022, 6:10am UTC](https://discourse.julialang.org/t/plots-borking-on-sentinelarrays-produced-by-csv-read/89505/2 "2022-10-30T06:10:10Z")

</div>

I came across this post

> [@Disable SentinelArrays for CSV.read](https://discourse.julialang.org/t/disable-sentinelarrays-for-csv-read/54843/6):
>
> This will be fixed soon. In general if you want to avoid SentinelVector (which often makes sense from my experience) set CSV.read to use a single thread when reading the data in (it will then be a bit slower but usually acceptably fast).

which recommends reading the CSV single-threaded. That works:

```julia
julia> wwdat1 = CSV.read("NWSSSarsCov2WastewaterConc.csv",DataFrame; ntasks = 1)
335417×4 DataFrame
...

julia> wwdat1.key_plot_id |> typeof
       # now it's a normal Vector, not a SentinelArray type
Vector{String} (alias for Array{String, 1})

julia> scatter(wwdat1.date,wwdat1.pcr_conc_smoothed) ## works.

```

![Screenshot_20221030_113317](https://global.discourse-cdn.com/julialang/original/3X/e/f/ef8132ac93aac5cbab8f4eab84d041d107e8bde9.png)

The same thread also suggests `collect`ing the column before plotting, as another way of managing this, and that works too:

```julia
julia> scatter(collect(wwdat.date), collect(wwdat.pcr_conc_smoothed)) # works

```

But reading the CSV with `ntasks = 1` is a fixed, one-time (per session) cost, so that’s probably better than `collect`ing for every plot call.

---

_[View the full topic](https://discourse.julialang.org/t/plots-borking-on-sentinelarrays-produced-by-csv-read/89505)._
