TimeSeries.jl package, some information missing from documentation

I’m studying the TimeSeries Package, which I find very useful.

However, I find that some information is missing from the documentation:

  1. the section on “Mathematical, comparison, and logical operators” does not include any examples

  2. I’ve been able to create a new TimeSeries Array by combining 2 different columns

ta[:, :col1] .+ ta[:, :col3]
  1. The result, however, is a new TimeSeries Array, that I can save.
ta2 = ta[:, :col1] .+ ta[:, :col3]
  1. I I want the result of my calculation added to my original Array, I need to execute a hcat
ta3 = hcat(ta, ta2)
  1. However, instead of creating a new TimeSeries Array, I would like to create directly an additional column, with something similar to:
ta[!, :col4] .= ta[:, :col1] .+ ta[:, :col3]

… which does not work

Am I doing something wrong?

I haven’t tried this myself using TimeSeriesArrays, but if you want to modify an existing array, you can just overwrite it:

ta = hcat(ta, ta2)

On standard Arrays:

julia> a = rand(3); b = rand(3)
3-element Vector{Float64}:
 0.9536106574209692
 0.7989128765471554
 0.43802663511779616

julia> a = hcat(a,b)
3×2 Matrix{Float64}:
 0.540416  0.953611
 0.403237  0.798913
 0.601049  0.438027

julia> a
3×2 Matrix{Float64}:
 0.540416  0.953611
 0.403237  0.798913
 0.601049  0.438027

I suggest using TSFrames package instead for time series data. TimeSeries is unmaintained.

Please see:

1 Like

@mdogan

TSFrames does not install in my PC

(@v1.8) pkg> add TSFrames
   Resolving package versions...
ERROR: TOML Parser error:
C:\Users\USUARIO\.julia\registries\General\R/Rotations\Versions.toml:1:1 error: invalid bare key character: '\0'

It seems to me that there is an error in the package.

Works fine for me, this looks more like your registry is corrupted, try ]registry rm General and ]registry add General

For me also looks fine. I can install it.