Hot wo get aligned data frame output table for Julia DataFrames #6097
-
DescriptionHello everyone! I have been using Julia for some time and have tried different ways to code. So far I liked Pluto, but wanted to try something else as well. Since I am coming from R, I wanted to try Quarto with Julia in VSCode. One problem I am having is that when I render for HTML, data frame outputs look not as I expected: Quarto has some options for tables such as tbl-colwidths, and df-print which in my case didn’t work. I guess this is probably because they are not defined for Julia? I don’t know but I was able to overcome this using markdown_table function, but this output lacks information about the types of columns. Is there any way that I can get the first table fixed? Thanks! Here is how my .qmd looks like: ---
title: "Data Frames"
execute:
cache: true
jupyter: julia-1.9
---
```{julia}
using DataFramesMeta, MarkdownTables, Random, Distributions
```
```{julia}
y = DataFrame(
x = round.(rand(10),digits=2),
y = rand(["A","B"],10),
z = sample(1:100,10),
w = 1
)
```
```{julia}
y = DataFrame(
x = round.(rand(10),digits=2),
y = rand(["A","B"],10),
z = sample(1:100,10),
w = 1
)
markdown_table(y)
``` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
These are (We'd like to get better table printing in non-knitr formats, and we agree that the options aren't great now.) |
Beta Was this translation helpful? Give feedback.
A workaround would be to use
knitr
as the engine and useJuliaCall
(https://non-contradiction.github.io/JuliaCall/index.html) to call Julia.