Skip to content

Commit

Permalink
Replace deprecated pandas.Styler.set_precision calls for Pandas 2.0.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588175220
Change-Id: I43d15b934b91183e7713848ed11fcc707811c768
  • Loading branch information
michevan authored and copybara-github committed Dec 5, 2023
1 parent 1be8b1f commit 804aa4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/end_to_end_demo_with_multiple_geos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
"\n",
"for i, corr_matrix in enumerate(correlations):\n",
" display(f\"geo {i}\")\n",
" display(corr_matrix.style.background_gradient(cmap='RdBu', vmin=-1, vmax=1).set_precision(3))\n",
" display(corr_matrix.style.background_gradient(cmap='RdBu', vmin=-1, vmax=1).format(precision=3))\n",
" display(\"--------------------------------------------------------------------\")"
]
},
Expand Down Expand Up @@ -619,7 +619,7 @@
" style = f'font-weight: {weight}; color: {color}'\n",
" return style\n",
"\n",
"variances.style.set_precision(4).applymap(highlight_variances)\n"
"variances.style.format(precision=4).applymap(highlight_variances)\n"
]
},
{
Expand Down Expand Up @@ -697,7 +697,7 @@
" style = f'font-weight: {weight}; color: {color}'\n",
" return style\n",
"\n",
"spend_fractions.style.set_precision(4).applymap(highlight_low_spend_fractions)\n"
"spend_fractions.style.format(precision=4).applymap(highlight_low_spend_fractions)\n"
]
},
{
Expand Down Expand Up @@ -783,7 +783,7 @@
" style = f'font-weight: {weight}; color: {color}'\n",
" return style\n",
"\n",
"variance_inflation_factors.style.set_precision(4).applymap(highlight_high_vif_values)\n"
"variance_inflation_factors.style.format(precision=4).applymap(highlight_high_vif_values)\n"
]
},
{
Expand Down

0 comments on commit 804aa4a

Please sign in to comment.