在使用 vscode 打开的 julia notebook 中,dataframe 输出格式为 latex,但结果未正确呈现:
> using DataFrames
> df = DataFrame(a=1:3)
\begin{tabular}{r|c}
& a\\
\hline
& Int64\\
\hline
1 & 1 \\
2 & 2 \\
3 & 3 \\
\end{tabular}
有没有办法配置 jupyter 扩展以获得 julia 数据帧的格式良好的输出?
我实际上使用的是 vscode 1.53.2 和 julia 1.6.0-rc1。
最佳答案
我像这样更新显示方法:
using DataFrames
Base.show(io::IO, ::MIME"text/latex", df::AbstractDataFrame) = show(df, backend=:html, show_row_number=true, highlighters=:tf_html_default )
然后我们可以从这一行看到格式正确的输出:
df = DataFrame(a=1:3)
关于visual-studio-code - 如何使用 VSCode Jupyter 扩展渲染 Julia 数据帧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66500065/