Ju_ska
October 4, 2024, 2:50pm
1
Hi,
I have this datafile:
data.jl (1.7 MB)
I plot doing:
using CSV
using Plots
csv=CSV.File("data.jl"; header=false, missingstring=["99999.00"])
res=hcat(csv.Column2,csv.Column3,csv.Column4,csv.Column5)
plot(csv.Column1,res, layout = (4, 1), legend=false, size=(1600,600))
But I have this strange result:
If I plot only:
plot(res[:,1], legend=false, size=(1600,600))
I got:
Any help is welcome !
nilshg
October 4, 2024, 2:54pm
2
You’re just missing data?
2 Likes
Ju_ska
October 4, 2024, 2:57pm
3
Well, no, I edited my post with a graph showing a single column plot.
nilshg
October 4, 2024, 3:00pm
4
But the single column plot has no x-values, so of course there can’t be any missing data?
Of course I don’t know what your column1
etc are, but your plot looks like this:
julia> plot([1:100; 200:300], rand(201))
1 Like
Ju_ska
October 4, 2024, 3:09pm
5
Mmm I think you nailed it, it’s indeed because of the change of day in the first column:
20240711235955 33871.41 880.29 17239.29 38019.23
20240712000000 33871.38 880.34 17239.26 38019.14
I should take a rest from time to time…
Thanks a lot !
2 Likes
nilshg
October 4, 2024, 3:18pm
6
Happens to the best of us
1 Like
In case you haven’t gotten the next step yet, it’s pretty straightforward to read those large integers directly as DateTimes
by using Dates
and passing two extra args to CSV
:
dateformat=dateformat"yyyymmddHHMMSS", types=Dict(1=>DateTime)
1 Like