From 804aa4ad8303201af8b37869d0dfb97ea8644dac Mon Sep 17 00:00:00 2001 From: Mike Anderson Date: Tue, 5 Dec 2023 13:38:30 -0800 Subject: [PATCH] Replace deprecated pandas.Styler.set_precision calls for Pandas 2.0. PiperOrigin-RevId: 588175220 Change-Id: I43d15b934b91183e7713848ed11fcc707811c768 --- examples/end_to_end_demo_with_multiple_geos.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/end_to_end_demo_with_multiple_geos.ipynb b/examples/end_to_end_demo_with_multiple_geos.ipynb index a7ec835..8537592 100644 --- a/examples/end_to_end_demo_with_multiple_geos.ipynb +++ b/examples/end_to_end_demo_with_multiple_geos.ipynb @@ -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(\"--------------------------------------------------------------------\")" ] }, @@ -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" ] }, { @@ -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" ] }, { @@ -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" ] }, {