Commit 0ac87a3d authored by Oisin Robinson's avatar Oisin Robinson
Browse files

Merge branch 'master' of git.ichec.ie:training/sohpc-training-2021

parents 553f5f6d 8794bdbe
......@@ -15,4 +15,4 @@ python Numpy_ex1_solution.py
python Numpy_ex2_solution.py
python Numpy_ex2_solution.py
\ No newline at end of file
python Numpy_ex3_solution.py
\ No newline at end of file
......@@ -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