Skip to content

Commit

Permalink
update plotting grouped data
Browse files Browse the repository at this point in the history
  • Loading branch information
jelletreep committed Feb 22, 2024
1 parent 02b9ecd commit 0c43d53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/data-science-with-pandas-4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@
"source": [
"fig, ax = plt.subplots()\n",
"\n",
"for i, group in list(surveys.groupby('sex')):\n",
" ax.scatter(group['hindfoot_length'], group['weight'], alpha=0.5, label = group['sex'].iloc[0])\n",
"for item, group in list(surveys.groupby('sex')):\n",
" ax.scatter(group['hindfoot_length'], group['weight'], alpha=0.5, label = item)\n",
" \n",
"ax.legend(title='sex')\n",
"ax.grid()\n",
Expand Down

0 comments on commit 0c43d53

Please sign in to comment.