Created
August 22, 2018 21:55
-
-
Save ericness/2f4ab0d65e6ccc488b9a4c816da5a2cb to your computer and use it in GitHub Desktop.
Reindex the DataFrame so that missing dates are filled in will zero values.
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
daily_orders = daily_orders.reindex(customer_date_index, fill_value=0) | |
daily_orders['running_amount'] = ( | |
daily_orders | |
.reindex() | |
.groupby('customer') | |
.cumsum() | |
) | |
print(daily_orders) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment