[ANN] PrettyTables.jl - Print formatted tables in Julia

Finally we have a initial version to work with.

@pdeffebach I will appreciate if you can provide some feedback :slight_smile:

4 Likes

I have used PrettyTables in my econometrics functions, which gives a nice standardized appearance, and I love the highlighters. At the moment, I’m highlighting p-values, but I may find more uses. :+1:

14 Likes

This is awesome! I am glad it is being useful :slight_smile:

I’d like to format integers to be better readable, e.g. 1,234,567 instead of 1234567. Is that somehow possible with PrettyTables?

1 Like

Yes! You can use the formatters with the correct configuration (see Formatting.jl):

julia> data = rand(10,4)*1_000_000;

julia> pretty_table(data, formatters = ft_printf("%'f"))
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Col. 1 β”‚         Col. 2 β”‚         Col. 3 β”‚         Col. 4 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  55,663.471352 β”‚ 565,113.348576 β”‚ 228,213.209548 β”‚ 596,933.831667 β”‚
β”‚ 598,850.511318 β”‚ 918,248.720496 β”‚ 808,481.418316 β”‚ 754,614.846689 β”‚
β”‚ 640,977.492383 β”‚ 626,533.558765 β”‚ 980,038.274199 β”‚ 610,184.850254 β”‚
β”‚ 287,743.186246 β”‚  76,687.541499 β”‚ 161,030.570764 β”‚ 240,375.325876 β”‚
β”‚ 857,151.015773 β”‚  11,965.878824 β”‚ 981,600.033788 β”‚ 477,896.870375 β”‚
β”‚ 221,924.099382 β”‚ 547,931.680008 β”‚ 747,265.226244 β”‚  98,563.283496 β”‚
β”‚ 248,303.297361 β”‚ 358,127.611747 β”‚ 823,934.355781 β”‚ 709,068.229827 β”‚
β”‚ 879,280.015089 β”‚ 916,188.034335 β”‚ 750,692.341263 β”‚ 635,150.198794 β”‚
β”‚ 170,127.288886 β”‚  74,977.650040 β”‚ 889,831.593324 β”‚ 250,795.355161 β”‚
β”‚ 304,763.211156 β”‚ 746,721.721851 β”‚ 220,722.897752 β”‚ 143,547.720656 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
9 Likes