Skip to content

Commit

Permalink
suppress divide by 0 warning in example 3
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobBD committed Sep 24, 2024
1 parent 4a4eb4f commit 54e989a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/example3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6266,7 +6266,8 @@
"source": [
"inflow = dynamic_stock.inflow\n",
"outflow = dynamic_stock.outflow\n",
"ratio_df = (outflow/inflow).to_df(index=False)\n",
"with np.errstate(divide='ignore'):\n",
" ratio_df = (outflow/inflow).to_df(index=False)\n",
"ratio_df = ratio_df.pivot(index='Time', columns='Region')['value']\n",
"\n",
"fig = px.line(ratio_df, title='Ratio outflow:inflow')\n",
Expand Down

0 comments on commit 54e989a

Please sign in to comment.