Group dataset with different series
See original GitHub issueI have the following dataset:
this.data = [
{ discipline: 1, originalBudgetDollars: 1114.96 },
{ discipline: 2, originalBudgetDollars: 192 },
{ discipline: 1, expendedDollars: 1137.24 },
{ discipline: 2, expendedDollars: 55.08 },
{ discipline: 1, forecastAtCompletionDollars: 1276.62 },
{ discipline: 2, forecastAtCompletionDollars: 96 },
{ discipline: 1, earnedValueDollars: 81.6 },
{ discipline: 2, earnedValueDollars: 10636.6 }
];
I would like to end up with the following dataset:
NOTE: the resulting dataset has a new column (remainingDollars) which is the difference between originalBudgetDollars and expendedDollars.
this.data = [
{ discipline: 1, originalBudgetDollars: 1114.96, expendedDollars: 1137.24, remainingDollars: -22.28, forecastAtCompletionDollars: 1276.62, earnedValueDollars: 81.6 },
{ discipline: 2, originalBudgetDollars: 192, expendedDollars: 55.08, remainingDollars: 136.92, forecastAtCompletionDollars: 96, earnedValueDollars: 10636.6 },
];
Is there a way to group on a series (e.g. discipline) while maintaining all of the unique series, and for icing on the cake… add a new series which is the result of a function?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
IMS 14 - Database administration - Multiple data set groups
The following database types support multiple data set groups: HDAM; PHDAM; HIDAM; PHIDAM. When storing a database on multiple data sets, the terms...
Read more >pandas GroupBy: Your Guide to Grouping Data in Python
You'll work with real-world datasets and chain GroupBy methods together to get ... A list of multiple column names; A dict or pandas...
Read more >Grouping and Sampling Time Series Data | by Shelvi Garg
Time-stamped is data collected at different points in time. ... Try and experiment your own with some cool time series dataset including weather...
Read more >Pandas - Groupby multiple values and plotting results
In this article, we will learn how to groupby multiple values and plotting the results in one go. Here, we take “exercise.csv” file...
Read more >Group by: split-apply-combine — pandas 1.5.2 documentation
This is included in GroupBy as the size method. It returns a Series whose index are the group names and whose values are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Works like a charm! Thank you.
Another thing is that you could dynamically generate
allCols
usingObject.entries
: