<p dir="auto">See example below. There is no "sex" in the styled table.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from IPython.display import display as d
import pandas as pd
df=pd.DataFrame.from_dict(dict(survived=[1,0,0,0,1,1,1,1], sex=[&quot;Male&quot;, &quot;Female&quot;, &quot;Male&quot;, &quot;Female&quot;, 
                                                                &quot;Male&quot;, &quot;Female&quot;,&quot;Female&quot;, &quot;Female&quot; ]))
table=pd.crosstab(df.survived, df.sex)
table.loc[&quot;rate&quot;] = table.iloc[-1] / table.sum()
d(table)
ftable = table.style.format(&quot;{:.0%}&quot;, subset=pd.IndexSlice[&quot;rate&quot;,:])
d(ftable)"><pre class="notranslate"><code class="notranslate">from IPython.display import display as d
import pandas as pd
df=pd.DataFrame.from_dict(dict(survived=[1,0,0,0,1,1,1,1], sex=["Male", "Female", "Male", "Female", 
                                                                "Male", "Female","Female", "Female" ]))
table=pd.crosstab(df.survived, df.sex)
table.loc["rate"] = table.iloc[-1] / table.sum()
d(table)
ftable = table.style.format("{:.0%}", subset=pd.IndexSlice["rate",:])
d(ftable)
</code></pre></div>
<p dir="auto">I don't know if anyone's profiled the test suite, but we'd get major performance boosts if we wrote a Cython version of assert_almost_equal. Is there another open issue for this already?</p>