Created
March 4, 2020 21:47
-
-
Save Joshuaek/b122256f61a65cc985cc9b8ab5061d85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def result(self): | |
# Ensure all calculations are done and return the dataframe | |
# First, sum all licence columns to get the total earned in that month from all live contracts | |
self.df['forecast_licences'] = self.df[[c.contract_name for c in self.contracts]].sum(axis=1) | |
# Secondly, calculate a cumulative total licence sales | |
self.df['total_sales'] = self.df.forecast_licences.cumsum() | |
return self.df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment