holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.39k stars 482 forks source link

Feature request: LaTeX column names for DataFrames #6770

Open HenningBeyer opened 2 months ago

HenningBeyer commented 2 months ago

You can see in the follwing image, how in Jupyter Lab the column names of a DataFrame can be rendered as LaTeX strings, which improves readability for physics datasets a lot.

I was frequent user of these LaTeX strings before using Panel, and would really like to see this added in the future. Thanks!

Jupyter_outputs

Here is the Code:

import pandas as pd import panel as pn pn.extension() pn.extension('mathjax', 'katex') df = pd.DataFrame([[1,2,3,4]], columns=[r'$$\text{Mean } x$$', r'$$\frac{\partial x}{\partial t}$$', r'$$\frac{\partial x}{\partial y}$$', r'$$\frac{\partial x}{\partial z}$$']) pn.pane.DataFrame(df)

HenningBeyer commented 2 months ago

Here is another image from inside a panel application I recently made:

image

I still could not find a way around it.