Skip to content

Commit 51dc185

Browse files
authored
Merge pull request statsmodels#8865 from bashtage/styler-applymap
MAINT: MOve from Styler.applymap to map
2 parents b061678 + c83a4bf commit 51dc185

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

statsmodels/multivariate/factor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,11 @@ def color_white_small(val):
873873
"""
874874
color = 'white' if np.abs(val) < threshold else 'black'
875875
return 'color: %s' % color
876-
877-
sty = loadings_df.style.applymap(color_white_small)
876+
try:
877+
sty = loadings_df.style.map(color_white_small)
878+
except AttributeError:
879+
# Deprecated in pandas 2.1
880+
sty = loadings_df.style.applymap(color_white_small)
878881

879882
if highlight_max is True:
880883
def highlight_max(s):

0 commit comments

Comments
 (0)