In [ ]:
% matplotlib inline
import matplotlib
#matplotlib.use('AGG')
from matplotlib.pyplot import bar, hist, savefig
import pandas
from django_pandas.io import read_frame
from lowfat import models
In [ ]:
claimants_per_year = models.Claimant.objects.all().values('application_year').annotate(total=Count('application_year'))
bar(
[claimant["application_year"] for claimant in claimants_per_year],
[claimant["total"] for claimant in claimants_per_year]
)
In [ ]:
fund_amount = models.Fund.objects.all().values('budget_approved')
hist(
[float(amount['budget_approved']) for amount in fund_amount],
5
)
In [ ]:
finances = read_frame(Expense.objects.all()).loc[:, ["send_to_finance_date", "amount_authorized_for_payment", "grant", "grant_heading"]]
finances.head()