Commit 8794bdbe authored by Antonio Villalpando's avatar Antonio Villalpando
Browse files

Update Pandas_exercises_solution.py

parent 47d6973c
......@@ -60,8 +60,8 @@ column for people with presence or absence of cardiovascular disease.
'''
print(' *****Exercise 3 - Plotting data *****')
Cardio['BMI'] = Cardio['weight'] / np.square(Cardio['height'] / 100)
ax = Cardio[Cardio['cardio'] == 1]['BMI'].hist(bins=50, alpha=0.5, legend='cardio issues')
Cardio[Cardio['cardio'] == 0]['BMI'].hist(bins=50, alpha=0.5, legend='cardio issues')
ax = Cardio[Cardio['cardio'] == 1]['BMI'].hist(bins=50, alpha=0.5)
Cardio[Cardio['cardio'] == 0]['BMI'].hist(bins=50, alpha=0.5)
handles, legends = ax.get_legend_handles_labels()
ax.legend(handles, ['cardio issues', 'no cardio issues'])
ax.set_xlabel('BMI')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment