Closed
Description
In the example below I would expect that 'np.nan' would be replaced by 'aaah'.
In [3]: df = pd.DataFrame({'a': np.arange(3), 'b': [0.1, np.nan, 0.2]})
In [4]: df
Out[4]:
a b
0 0 0.1
1 1 NaN
2 2 0.2
In [5]: print(df.to_latex(formatters={'b': lambda x: '{:0.4f}'.format(x)}, na_rep='aaah'))
\begin{tabular}{lrr}
\toprule
{} & a & b \\
\midrule
0 & 0 & 0.1000 \\
1 & 1 & nan \\
2 & 2 & 0.2000 \\
\bottomrule
\end{tabular}