Код: Выделить всё
import pandas as pd
df = pd.DataFrame(
dict(name=['Raphael', 'Donatello'],
mask=['red', 'purple'],
weapon=['sai', 'bo staff']
)
)
print(df.style.hide(axis="index").applymap_index(lambda v: "font-weight: bold;", axis="columns").to_latex(convert_css=True))
Код: Выделить всё
\begin{tabular}{lll}
\bfseries name & \bfseries mask & weapon \\
Raphael & red & sai \\
Donatello & purple & bo staff \\
\end{tabular}
Если я не скрыл индекс с помощью:
Код: Выделить всё
print(df.style.applymap_index(lambda v: "font-weight: bold;", axis="columns").to_latex(convert_css=True))
Код: Выделить всё
\begin{tabular}{llll}
& \bfseries name & \bfseries mask & \bfseries weapon \\
0 & Raphael & red & sai \\
1 & Donatello & purple & bo staff \\
\end{tabular}
Похоже, это ошибка панд, и я поднял проблему.
Итак, есть ли какие-нибудь способы решения, прежде чем ошибка будет исправлена?
Подробнее здесь: https://stackoverflow.com/questions/758 ... ogether-wi
Мобильная версия