Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to avoid renaming columns when broadcasting #159

Open
asinghvi17 opened this issue Mar 8, 2023 · 1 comment
Open

How to avoid renaming columns when broadcasting #159

asinghvi17 opened this issue Mar 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@asinghvi17
Copy link
Member

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
Copy link
Member

I think the columns are getting renamed even when renamecols is false:

select(
ts.coredata,
:Index,
Not(:Index) .=> (x -> f.(x)) => colname -> string(colname, "_", Symbol(f)),
renamecols = renamecols

@chiraganand chiraganand added the bug Something isn't working label Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants