Closed
Description
This code is ok under Pandas-0.18.1 (from a @jreback demo)
%matplotlib inline
# Pandas interactive
import pandas as pd
import numpy as np
import seaborn as sns
# create a df with random datas
np.random.seed(24)
df = pd.DataFrame({'A': np.linspace(1, 10, 10)})
df = pd.concat([df, pd.DataFrame(np.random.randn(10, 4), columns=list('BCDE'))],
axis=1)
df.iloc[0, 2] = np.nan
# interactive
from IPython.html import widgets
@widgets.interact
def f(h_neg=(0, 359, 1), h_pos=(0, 359), s=(0., 99.9), l=(0., 99.9)):
return (df
.style
.background_gradient(
cmap=sns.palettes.diverging_palette(
h_neg=h_neg, h_pos=h_pos, s=s, l=l, as_cmap=True)
).highlight_null()
)
With Pandas-0.19rc1, I get a warning: