xKDR / TSFrames.jl

Timeseries in Julia
MIT License
89 stars 22 forks source link

How to avoid renaming columns when broadcasting #159

Open asinghvi17 opened 1 year ago

asinghvi17 commented 1 year ago

It seems like TSFrames overrides the behaviour of broadcast such that it renames the column names when a function is broadcast across a TSFrame. How can I stop this from happening?

E.g.:

log_ts = log.(ts)
5×2 TSFrame with Int64 Index
 Index  var1_log     var2_log  
 Int64  Float64      Float64   
───────────────────────────────
    -2  -Inf         -1.38629
    -1    -1.09861   -0.693147
     0    -0.405465  -0.287682
     1     0.0        0.0
     2     0.0        0.0

How can I get the column names to be var1 and var2 without renaming them? I tried passing renamecols to Base.broadcasted(log, ts; renamecols = false) but that doesn't seem to do anything.

chiraganand commented 1 year ago

I think the columns are getting renamed even when renamecols is false: https://github.com/xKDR/TSFrames.jl/blob/305267dd2bd1ddcc94253e97efe01621e6d0cac5/src/broadcasting.jl#L3-L7