Skip to content

Commit

Permalink
Fix finances page
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Oct 22, 2024
1 parent 36ffe56 commit 2b30b27
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions book/finances.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ for ix, irow in opportunities.iterrows():
opportunities.loc[ix, "Weighted Value for 2i2c"] = irow["Value for 2i2c"]
else:
opportunities.loc[ix, "Category"] = f"{irow['Category']}-Prospective"
# Ensure numeric values
numeric_cols = ["Weighted Value for 2i2c", "Value for 2i2c"]
for col in numeric_cols:
opportunities.loc[:, col] = opportunities.loc[:, col].astype(float)
```
```{code-cell} ipython3
Expand Down Expand Up @@ -374,7 +379,7 @@ qu_committed = f"`Stage` in ['Committed', 'Contract Admin']"
colors = {
"Services-Committed": twoc.colors["bigblue"],
"Giving-Committed": twoc.colors["coral"],
"Giving-Prospective": "lightcoral"
"Giving-Prospective": "lightcoral",
"Services-Prospective": "lightblue",
}
Expand All @@ -393,7 +398,7 @@ bar_kwargs = dict(
figures = {}
labels = ["estimated", "committed", "full", "categories"]
labels = ["committed", "estimated", "full", "estimated (categories)"]
for label in labels:
# Bar plot of revenue
data_plot = amortized_records.query(qu_date)
Expand All @@ -405,7 +410,7 @@ for label in labels:
elif label == "estimated":
iname = "Monthly amount (expected)"
title = "Monthly Revenue (weighted by probability success)"
elif label == "categories":
elif "categories" in label:
data_plot = data_plot.groupby(["Date", "Category"]).sum("Monthly amount (expected)")
data_plot = data_plot.reset_index()
data_plot["Name"] = data_plot["Category"]
Expand Down Expand Up @@ -455,3 +460,7 @@ for ii, ilabel in enumerate(labels):
# Display the tab widget
display(tabs)
```
```{code-cell} ipython3
```

0 comments on commit 2b30b27

Please sign in to comment.