Split only some columns? #2126
Unanswered
woodsy-sounding-wilful-sapwood
asked this question in
Q&A
Replies: 1 comment 3 replies
-
How about using an expression column for your {
"group_by": ["concat(\"Ticker\",', ',\"Name\")"],
"split_by": ["Quarter"],
"columns": ["Result"],
"expressions":["concat(\"Ticker\",', ',\"Name\")"]
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say I have a data source like this:
I would like to pivot this so the index/left-most columns are the ticker and name and the columns are Q1, Q2, Q3 etc
(Essentially
df.pivot_table(index=['Ticker', 'Name'], columns='Quarter', values='Result')
)If I do
group_by(['Ticker', 'Name'])
andsplit_by(['Quarter'])
, perspective puts the name on a separate line which is a) annoying if there are multiple columns in the index and b) confusing because you lose the column nameIf I do
group_by(['Ticker'])
andsplit_by(['Quarter'])
, perspective repeats the name for every quarter which is redundant.Is there a way to say "group by ticker and split result by quarter but do not split name"?
Beta Was this translation helpful? Give feedback.
All reactions