-
Notifications
You must be signed in to change notification settings - Fork 373
Description
It seems to me, that DataFrames within a Jupyter notebook are by default rendered using a LaTeX-format. This is no problem when the notebook is
- displayed in a preview using HTML
- rendered to PDF using LaTeX
But in the meantime there is also the possibility to render a Jupyter notebook (in VS Code which uses Quarto) to PDF using Typst.
A DataFrame like
df = DataFrame(
fruit = ["banana", "apple"],
price = [4.5, 3.6]
)get's in this processing pipeline still converted to:
\begin{tabular}{r|cc}
& fruit & price\\
\hline
& String & Float64\\
\hline
1 & banana & 4.5 \\
2 & apple & 3.6 \\
\end{tabular}This cannot be processed further. So DataFrames don't show up in the PDFs created this way. I have already created an issue on this topic (with more details) in the Quarto repo (quarto-dev/quarto-cli#12298). But in the meantime I think, this is rather a DataFrame-specific problem.
As I understand, DataFrames use PrettyTables do display themselves in different formats (using so-called backends). Is there a way to change the default backend used by DataFrames within a Jupyter notebook?
From the PrettyTables documentation I just saw that the backend can be choosen for specific explicit calls to their rendering functions. But I don't understand how to change the backend globally within a notebook.