When I run this code
import pandas as pd
import numpy as np
def add_prop(group):
births = group.births.astype(float)
group[\'prop\'] = births/births.
your code is correct. just put:
import matplotlib as plt
for diplaying you plot:
plt.show()
Put
import matplotlib.pyplot as plt
at the top, and
plt.show()
at the end.
In the IPython notebook you could also use %matplotlib inline
at the top of the notebook to automatically display the created plots in the output cells.