Fix/test and missing definition (#18)

* added missing comment on setting up matplotlib

* changed assertion description so that it makes sense

* fig definition

* new comment
main
Ilenia 2 years ago committed by GitHub
parent 331d1610dd
commit 988c0755a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,11 +20,16 @@ def draw_cat_plot():
# Group and reformat the data to split it by 'cardio'. Show the counts of each feature. You will have to rename one of the columns for the catplot to work correctly.
df_cat = None
# Draw the catplot with 'sns.catplot()'
# Get the figure for the output
fig = None
# Do not modify the next two lines
fig.savefig('catplot.png')
return fig

@ -38,7 +38,7 @@ class HeatMapTestCase(unittest.TestCase):
for label in self.ax.get_xticklabels():
actual.append(label.get_text())
expected = ['id', 'age', 'sex', 'height', 'weight', 'ap_hi', 'ap_lo', 'cholesterol', 'gluc', 'smoke', 'alco', 'active', 'cardio', 'overweight']
self.assertEqual(actual, expected, "Expected bar plot legend labels to be months of the year.")
self.assertEqual(actual, expected, "Expected heat map labels to be 'id', 'age', 'sex', 'height', 'weight', 'ap_hi', 'ap_lo', 'cholesterol', 'gluc', 'smoke', 'alco', 'active', 'cardio', 'overweight'.")
def test_heat_map_values(self):
actual = [text.get_text() for text in self.ax.get_default_bbox_extra_artists() if isinstance(text, mpl.text.Text)]

Loading…
Cancel
Save