I want to figure out where is the duplicate data which cause this error, but how?
using DataFrames, TimeSeries, CSV
s = "2019-12-25,3
2020-01-01,6
2019-12-25,9
2020-01-02,10
2020-01-03,11
2020-01-04,12
2020-01-02,13
2020-01-02,14"
df=CSV.read(IOBuffer(s), types=[Date,Int], header=["timestamp","V")
ta = TimeArray(df, timestamp=:timestamp)
error message
ERROR: ArgumentError: timestamps must be strictly monotonic
Stacktrace:
[1] (::TimeSeries.var"#_#1#2")(::Bool, ::Type{TimeArray{Int64,1,Date,Array{Int64,1}}}, ::Array{Date,1}, ::Array{Int64,1}, ::Array{Symbol,1}, ::DataFrame) at /home/dlin/.julia/packages/TimeSeries/8Z5Is/src/timearray.jl:81
[2] TimeArray at /home/dlin/.julia/packages/TimeSeries/8Z5Is/src/timearray.jl:65 [inlined]
[3] #TimeArray#3 at /home/dlin/.julia/packages/TimeSeries/8Z5Is/src/timearray.jl:89 [inlined]
[4] TimeArray(::Array{Date,1}, ::Array{Int64,1}, ::Array{Symbol,1}, ::DataFrame) at /home/dlin/.julia/packages/TimeSeries/8Z5Is/src/timearray.jl:89
[5] #TimeArray#3(::Symbol, ::Type{TimeArray}, ::DataFrame) at /home/dlin/.julia/packages/TimeSeries/8Z5Is/src/tables.jl:70
[6] (::Core.var"#kw#Type")(::NamedTuple{(:timestamp,),Tuple{Symbol}}, ::Type{TimeArray}, ::DataFrame) at ./none:0
[7] top-level scope at REPL[239]:1
I want to find out which index caused the error, may similar to
│ Row │ timestamp │ V │
│ │ Date │ Int64 │
├─────┼────────────┼───────┤
│ 1 │ 2019-12-25 │ 3 │
│ 3 │ 2019-12-25 │ 9 │
Or even better find out all non unique value rows
│ Row │ timestamp │ V │
│ │ Date │ Int64 │
├─────┼────────────┼───────┤
│ 1 │ 2019-12-25 │ 3 │
│ 3 │ 2019-12-25 │ 9 │
│ 4 │ 2020-01-02 │ 10 │
│ 7 │ 2020-01-02 │ 13 │
│ 8 │ 2020-01-02 │ 14 │