Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions learntools/data_viz_to_coder/ex5.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class PlotThreshold(CodingProblem):
"malignant, use `hue=`. Set `shade=True`.")
_solution = CS(
"""# KDE plots for benign and malignant tumors
sns.kdeplot(data=cancer_data, x='Radius (worst)', hue='Diagnosis', shade=True)
sns.kdeplot(data=cancer_data, x='Radius (worst)', hue='Diagnosis', fill=True)
""")

def solution_plot(self):
self._view.solution()
sns.kdeplot(data=df, x='Radius (worst)', hue='Diagnosis', shade=True)
sns.kdeplot(data=df, x='Radius (worst)', hue='Diagnosis', fill=True)

def check(self, passed_plt):
assert len(passed_plt.figure(1).axes) > 0, \
Expand Down
4 changes: 2 additions & 2 deletions notebooks/data_viz_to_coder/raw/ex5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"outputs": [],
"source": [
"#%%RM_IF(PROD)%%\n",
"sns.kdeplot(data=cancer_data, x='Radius (worst)', hue='Diagnosis', shade=True)\n",
"sns.kdeplot(data=cancer_data, x='Radius (worst)', hue='Diagnosis', fill=True)\n",
"step_4.a.assert_check_passed()"
]
},
Expand All @@ -312,7 +312,7 @@
"outputs": [],
"source": [
"#%%RM_IF(PROD)%%\n",
"#sns.kdeplot(data=cancer_b_data['Radius (worst)'], shade=True, label=\"Benign\")\n",
"#sns.kdeplot(data=cancer_b_data['Radius (worst)'], fill=True, label=\"Benign\")\n",
"#step_4.a.assert_check_failed()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/data_viz_to_coder/raw/tut5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"outputs": [],
"source": [
"# KDE plots for each species\n",
"sns.kdeplot(data=iris_data, x='Petal Length (cm)', hue='Species', shade=True)\n",
"sns.kdeplot(data=iris_data, x='Petal Length (cm)', hue='Species', fill=True)\n",
"\n",
"# Add title\n",
"plt.title(\"Distribution of Petal Lengths, by Species\")"
Expand Down