All Tables Test - New TestDFGenerator test_suite

Author

Stephen J. Mildenhall

Published

March 14, 2025

Code
from IPython.display import HTML, display
import matplotlib as mpl
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

import greater_tables as gter
import greater_tables.utilities as gtu
from greater_tables import GT, sGT
gter.logger.setLevel(gter.logging.WARNING)

…code build completed.

1 A Hard-Rules table

Second level index has mixed types. Range of magnitudes. Picking out years.

Code
level_1 = ["A", "A", "B", "B", 'C']
level_2 = ['Int', 'Float', 'Float', 3, 'Longer Text']

multi_index = pd.MultiIndex.from_arrays([level_1, level_2],
        names=["Level 1", "Level 2"])
start = pd.Timestamp.today().normalize()  # Today's date, normalized to midnight
end = pd.Timestamp(f"{start.year}-12-31")  # End of the year

hard = pd.DataFrame(
{'years!': np.arange(2000, 2025, dtype=int),
'a': np.array(np.round(np.linspace(-100000, 100000, 25), 0), dtype=int),
'b': 9.3 ** np.linspace(-12, 12, 25),
'c': np.linspace(-1601, 4000, 25),
'd': pd.date_range(start=start, end=end, periods=25),
'e': ('once upon a time, risk is hard to define, not in Kansas anymore, '
        'neutrinos are hard to detect,  '
        'Adam Smith is the father of economics'.split(',') * 5)
}).set_index('years!')
# hard = hard.head()
hard.columns = multi_index
hard
Table 1: Default display output (Quarto generated caption)
Level 1 A B C
Level 2 Int Float Float 3 Longer Text
years!
2000 -100000 2.388937e-12 -1601.000 2025-03-14 00:00:00 once upon a time
2001 -91667 2.221711e-11 -1367.625 2025-03-26 04:00:00 risk is hard to define
2002 -83333 2.066191e-10 -1134.250 2025-04-07 08:00:00 not in Kansas anymore
2003 -75000 1.921558e-09 -900.875 2025-04-19 12:00:00 neutrinos are hard to detect
2004 -66667 1.787049e-08 -667.500 2025-05-01 16:00:00 Adam Smith is the father of economics
2005 -58333 1.661955e-07 -434.125 2025-05-13 20:00:00 once upon a time
2006 -50000 1.545619e-06 -200.750 2025-05-26 00:00:00 risk is hard to define
2007 -41667 1.437425e-05 32.625 2025-06-07 04:00:00 not in Kansas anymore
2008 -33333 1.336805e-04 266.000 2025-06-19 08:00:00 neutrinos are hard to detect
2009 -25000 1.243229e-03 499.375 2025-07-01 12:00:00 Adam Smith is the father of economics
2010 -16667 1.156203e-02 732.750 2025-07-13 16:00:00 once upon a time
2011 -8333 1.075269e-01 966.125 2025-07-25 20:00:00 risk is hard to define
2012 0 1.000000e+00 1199.500 2025-08-07 00:00:00 not in Kansas anymore
2013 8333 9.300000e+00 1432.875 2025-08-19 04:00:00 neutrinos are hard to detect
2014 16667 8.649000e+01 1666.250 2025-08-31 08:00:00 Adam Smith is the father of economics
2015 25000 8.043570e+02 1899.625 2025-09-12 12:00:00 once upon a time
2016 33333 7.480520e+03 2133.000 2025-09-24 16:00:00 risk is hard to define
2017 41667 6.956884e+04 2366.375 2025-10-06 20:00:00 not in Kansas anymore
2018 50000 6.469902e+05 2599.750 2025-10-19 00:00:00 neutrinos are hard to detect
2019 58333 6.017009e+06 2833.125 2025-10-31 04:00:00 Adam Smith is the father of economics
2020 66667 5.595818e+07 3066.500 2025-11-12 08:00:00 once upon a time
2021 75000 5.204111e+08 3299.875 2025-11-24 12:00:00 risk is hard to define
2022 83333 4.839823e+09 3533.250 2025-12-06 16:00:00 not in Kansas anymore
2023 91667 4.501035e+10 3766.625 2025-12-18 20:00:00 neutrinos are hard to detect
2024 100000 4.185963e+11 4000.000 2025-12-31 00:00:00 Adam Smith is the father of economics

Table 1 shows the default output and Table 2 the sGT format output.

Code
sGT(hard, 'A table with varied columns.')
Table 2: Greater Tables output (Quarto generated caption)
A table with varied columns.
A B C
years! Int Float Float 3 Longer Text
2000 -100,000 2.389p -1,601.00 2025-03-14 once upon a time
2001 -91,667 22.217p -1,367.62 2025-03-26 risk is hard to define
2002 -83,333 206.619p -1,134.25 2025-04-07 not in Kansas anymore
2003 -75,000 1.922n -900.88 2025-04-19 neutrinos are hard to detect
2004 -66,667 17.870n -667.50 2025-05-01 Adam Smith is the father of economics
2005 -58,333 166.196n -434.12 2025-05-13 once upon a time
2006 -50,000 1.546u -200.75 2025-05-26 risk is hard to define
2007 -41,667 14.374u 32.62 2025-06-07 not in Kansas anymore
2008 -33,333 133.681u 266.00 2025-06-19 neutrinos are hard to detect
2009 -25,000 1.243m 499.38 2025-07-01 Adam Smith is the father of economics
2010 -16,667 11.562m 732.75 2025-07-13 once upon a time
2011 -8,333 107.527m 966.12 2025-07-25 risk is hard to define
2012 0 1.000 1,199.50 2025-08-07 not in Kansas anymore
2013 8,333 9.300 1,432.88 2025-08-19 neutrinos are hard to detect
2014 16,667 86.490 1,666.25 2025-08-31 Adam Smith is the father of economics
2015 25,000 804.357 1,899.62 2025-09-12 once upon a time
2016 33,333 7.481k 2,133.00 2025-09-24 risk is hard to define
2017 41,667 69.569k 2,366.38 2025-10-06 not in Kansas anymore
2018 50,000 646.990k 2,599.75 2025-10-19 neutrinos are hard to detect
2019 58,333 6.017M 2,833.12 2025-10-31 Adam Smith is the father of economics
2020 66,667 55.958M 3,066.50 2025-11-12 once upon a time
2021 75,000 520.411M 3,299.88 2025-11-24 risk is hard to define
2022 83,333 4.840G 3,533.25 2025-12-06 not in Kansas anymore
2023 91,667 45.010G 3,766.62 2025-12-18 neutrinos are hard to detect
2024 100,000 418.596G 4,000.00 2025-12-31 Adam Smith is the father of economics

Here are some alternatives:

Code
```{python}
#| label: tbl-hard-rules-3a
#| tbl-cap: No V rules but hrules (Quarto generated caption)
display(sGT(hard.sample(5).sort_index(),
        caption='GT caption No v rules, but h rules',
        vrule_widths=(0,0,0),
        hrule_widths=(1,0,0)))
```
Table 3: No V rules but hrules (Quarto generated caption)
GT caption No v rules, but h rules
A B C
years! Int Float Float 3 Longer Text
2002 -83,333 206.619p -1,134.25 2025-04-07 not in Kansas anymore
2004 -66,667 17.870n -667.50 2025-05-01 Adam Smith is the father of economics
2015 25,000 804.357 1,899.62 2025-09-12 once upon a time
2018 50,000 646.990k 2,599.75 2025-10-19 neutrinos are hard to detect
2021 75,000 520.411M 3,299.88 2025-11-24 risk is hard to define
Code
```{python}
#| label: tbl-hard-rules-3b
#| tbl-cap: Change date and integer formats  (Quarto generated caption)
display(sGT(hard.sample(5).sort_index(),
        caption='Change default date and integer formats',
        default_date_str='%m-%d', default_integer_str='[{x:d}]'))
```
Table 4: Change date and integer formats (Quarto generated caption)
Change default date and integer formats
A B C
years! Int Float Float 3 Longer Text
2003 [-75000] 1.922n -900.88 04-19 neutrinos are hard to detect
2005 [-58333] 166.196n -434.12 05-13 once upon a time
2011 [-8333] 107.527m 966.12 07-25 risk is hard to define
2018 [50000] 646.990k 2,599.75 10-19 neutrinos are hard to detect
2023 [91667] 45.010G 3,766.62 12-18 neutrinos are hard to detect
Code
```{python}
#| label: tbl-hard-rules-3c
#| tbl-cap: Change padding and debug mode, boxes (Quarto generated caption)
display(sGT(hard.sample(5).sort_index(),
        caption='Change padding, debug mode lines',
        padding_trbl=(10, 10, 20, 20), debug=True))
```
Table 5: Change padding and debug mode, boxes (Quarto generated caption)
Change padding, debug mode lines (id: TEEUJQBUI2GUC)
A B C
years! Int Float Float 3 Longer Text
2004 -66,667 17.870n -667.50 2025-05-01 Adam Smith is the father of economics
2006 -50,000 1.546u -200.75 2025-05-26 risk is hard to define
2008 -33,333 133.681u 266.00 2025-06-19 neutrinos are hard to detect
2021 75,000 520.411M 3,299.88 2025-11-24 risk is hard to define
2022 83,333 4.840G 3,533.25 2025-12-06 not in Kansas anymore

Here is the raw HTML and LaTeX output.

Code
f = sGT(hard.head(4), debug=True)
print('HTML output\n')
print(f._repr_html_())

print('\n\n\nTeX output\n')
print(f._repr_latex_())
HTML output

<div class="greater-table">
<style>
    #TIPUZXJD7G5EM  {
    border-collapse: collapse;
    font-family: "Roboto", "Open Sans Condensed", "Arial", 'Segoe UI', sans-serif;
    font-size: 0.9em;
    width: auto;
    /* tb and lr 
    width: fit-content; */
    margin: 10px auto; 
    border: none;
    overflow: auto;
    margin-left: auto;
    margin-right: auto;
    }
    /* tag formats */
    #TIPUZXJD7G5EM caption {
        padding: 8px 10px 4px 10px;
        font-size: 0.99em;
        text-align: center;
        font-weight: normal;
        caption-side: top;
    }
    #TIPUZXJD7G5EM thead {
        /* top and bottom of header */
        border-top: 1px solid #0ff;
        border-bottom: 1px solid #0ff;
        font-size: 0.99em;
        }
    #TIPUZXJD7G5EM tbody {
        /* bottom of body */
        border-bottom: 1px solid #f0f;
        }
    #TIPUZXJD7G5EM th  {
        vertical-align: bottom;
        padding: 8px 10px 8px 10px;
    }
    #TIPUZXJD7G5EM td {
        /* top, right, bottom left cell padding */
        padding: 4px 10px 4px 10px;
        vertical-align: top;
    }
    /* class overrides */
    #TIPUZXJD7G5EM .grt-hrule-0 {
        border-top: 0px solid #f00;
    }
    #TIPUZXJD7G5EM .grt-hrule-1 {
        border-top: 0px solid #b00;
    }
    #TIPUZXJD7G5EM .grt-hrule-2 {
        border-top: 0px solid #900;
    }
    /* for the header, there if you have v lines you want h lines
       hence use vrule_widths */
    #TIPUZXJD7G5EM .grt-bhrule-0 {
        border-bottom: 1.5px solid #f00;
    }
    #TIPUZXJD7G5EM .grt-bhrule-1 {
        border-bottom: 1px solid #b00;
    }
    #TIPUZXJD7G5EM .grt-vrule-index {
        border-left: 1.5px solid #0f0;
    }
    #TIPUZXJD7G5EM .grt-vrule-0 {
        border-left: 1.5px solid #0f0;
    }
    #TIPUZXJD7G5EM .grt-vrule-1 {
        border-left: 1px solid #0a0;
    }
    #TIPUZXJD7G5EM .grt-vrule-2 {
        border-left: 0.5px solid #090;
    }
    #TIPUZXJD7G5EM .grt-left {
        text-align: left;
    }
    #TIPUZXJD7G5EM .grt-center {
        text-align: center;
    }
    #TIPUZXJD7G5EM .grt-right {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }
    #TIPUZXJD7G5EM .grt-head {
        font-family: "Times New Roman", 'Courier New';
        font-size: 0.99em;
    }
    #TIPUZXJD7G5EM .grt-bold {
        font-weight: bold;
    }
</style>
<table id="TIPUZXJD7G5EM">
<caption> (id: TIPUZXJD7G5EM)</caption>
<colgroup>
<col style="width: 3.0em;"/>
<col style="width: 4.0em;"/>
<col style="width: 4.5em;"/>
<col style="width: 4.5em;"/>
<col style="width: 5.0em;"/>
<col style="width: 14.5em;"/>
</colgroup>
<thead>
<tr>
<th class="grt-left"></th>
<th class="grt-center grt-bhrule-0 grt-vrule-index" colspan="2">A</th>
<th class="grt-center grt-bhrule-0 grt-vrule-0" colspan="2">B</th>
<th class="grt-center grt-bhrule-0 grt-vrule-0" colspan="1">C</th>
</tr>
<tr>
<th class="grt-left">years!</th>
<th class="grt-center grt-vrule-index" colspan="1">Int</th>
<th class="grt-center grt-vrule-1" colspan="1">Float</th>
<th class="grt-center grt-vrule-0" colspan="1">Float</th>
<th class="grt-center grt-vrule-1" colspan="1">3</th>
<th class="grt-center grt-vrule-0" colspan="1">Longer Text</th>
</tr>
</thead>
<tbody>
<tr>
<td class="grt-left">2000</td>
<td class="grt-right grt-vrule-index">-100,000</td>
<td class="grt-right grt-vrule-1"> 2.389p</td>
<td class="grt-right grt-vrule-0">-1,601.00</td>
<td class="grt-center grt-vrule-1">2025-03-14</td>
<td class="grt-left grt-vrule-0">once upon a time</td>
</tr>
<tr>
<td class="grt-left grt-hrule-0">2001</td>
<td class="grt-right grt-hrule-0 grt-vrule-index">-91,667</td>
<td class="grt-right grt-hrule-0 grt-vrule-1"> 22.217p</td>
<td class="grt-right grt-hrule-0 grt-vrule-0">-1,367.62</td>
<td class="grt-center grt-hrule-0 grt-vrule-1">2025-03-26</td>
<td class="grt-left grt-hrule-0 grt-vrule-0"> risk is hard to define</td>
</tr>
<tr>
<td class="grt-left grt-hrule-0">2002</td>
<td class="grt-right grt-hrule-0 grt-vrule-index">-83,333</td>
<td class="grt-right grt-hrule-0 grt-vrule-1"> 206.619p</td>
<td class="grt-right grt-hrule-0 grt-vrule-0">-1,134.25</td>
<td class="grt-center grt-hrule-0 grt-vrule-1">2025-04-07</td>
<td class="grt-left grt-hrule-0 grt-vrule-0"> not in Kansas anymore</td>
</tr>
<tr>
<td class="grt-left grt-hrule-0">2003</td>
<td class="grt-right grt-hrule-0 grt-vrule-index">-75,000</td>
<td class="grt-right grt-hrule-0 grt-vrule-1"> 1.922n</td>
<td class="grt-right grt-hrule-0 grt-vrule-0">-900.88</td>
<td class="grt-center grt-hrule-0 grt-vrule-1">2025-04-19</td>
<td class="grt-left grt-hrule-0 grt-vrule-0"> neutrinos are hard to detect</td>
</tr>
</tbody>
</table></div>



TeX output


\begin{tikzpicture}[
    auto,
    transform shape,
    nosep/.style={inner sep=0},
    table/.style={
        matrix of nodes,
        row sep=0.125em,
        column sep=0.375em,
        nodes in empty cells,
        nodes={rectangle, scale=0.635, text badly ragged , draw=blue!10},
    row 1/.style={nodes={text=black, anchor=north, inner ysep=0, text height=0, text depth=0}},
    row 2/.style={nodes={text=black, anchor=south, inner ysep=.2em, minimum height=1.3em, font=\bfseries}},
    row 3/.style={nodes={text=black, anchor=south, inner ysep=.2em, minimum height=1.3em, font=\bfseries}},
    column  1/.style={nodes={align=left  }, text height=0.9em, text depth=0.2em, inner xsep=0.375em, inner ysep=0, text width=3.60em},
    column  2/.style={nodes={align=right }, nosep, text width=17.40em},
    column  3/.style={nodes={align=right }, nosep, text width=17.40em},
    column  4/.style={nodes={align=right }, nosep, text width=17.40em},
    column  5/.style={nodes={align=center}, nosep, text width=17.40em},
    column  6/.style={nodes={align=left  }, nosep, text width=17.40em},
    column  7/.style={text height=0.9em, text depth=0.2em, nosep, text width=0em}   }]
\matrix (TIPUZXJD7G5EM) [table, ampersand replacement=\&]{
      \&          \&           \&           \&            \&                               \& \\
 \grtspacer \& A\grtspacer \& \grtspacer \& B\grtspacer \& \grtspacer \& C\grtspacer                   \& \\
 years!\grtspacer \& Int\grtspacer \& Float\grtspacer \& Float\grtspacer \& 3\grtspacer \& Longer Text\grtspacer         \& \\
 2000 \& -100,000 \&    2.389p \& -1,601.00 \& 2025-03-14 \& once upon a time              \& \\
 2001 \&  -91,667 \&   22.217p \& -1,367.62 \& 2025-03-26 \&  risk is hard to define       \& \\
 2002 \&  -83,333 \&  206.619p \& -1,134.25 \& 2025-04-07 \&  not in Kansas anymore        \& \\
 2003 \&  -75,000 \&    1.922n \&   -900.88 \& 2025-04-19 \&  neutrinos are hard to detect \& \\
};

\path[draw, thick] (TIPUZXJD7G5EM-1-1.south west)  -- (TIPUZXJD7G5EM-1-7.south east);
\path[draw, semithick] ([yshift=-0.0625em]TIPUZXJD7G5EM-3-1.south west)  -- ([yshift=-0.0625em]TIPUZXJD7G5EM-3-7.south east);
\path[draw, thick] ([yshift=-0.3125em]TIPUZXJD7G5EM-7-1.base west)  -- ([yshift=-0.3125em]TIPUZXJD7G5EM-7-7.base east);
\path[draw, very thin] ([xshift=-0.1875em, yshift=-0.0625em]TIPUZXJD7G5EM-2-2.south west)  -- ([yshift=-0.0625em]TIPUZXJD7G5EM-2-7.south east);
\path[draw, very thin] ([xshift=-0.1875em]TIPUZXJD7G5EM-1-2.south west)  -- ([yshift=-0.3125em, xshift=-0.1875em]TIPUZXJD7G5EM-7-2.base west);
\path[draw, ultra thin] ([xshift=0.1875em, yshift=-0.0625em]TIPUZXJD7G5EM-1-3.south east)  -- ([yshift=-0.3125em, xshift=0.1875em]TIPUZXJD7G5EM-7-3.base east);
\path[draw, ultra thin] ([xshift=0.1875em, yshift=-0.0625em]TIPUZXJD7G5EM-1-5.south east)  -- ([yshift=-0.3125em, xshift=0.1875em]TIPUZXJD7G5EM-7-5.base east);



\end{tikzpicture}

2 A Table with TeX Content

Code
index = pd.Index(["A", "B", "$C_1$", "C_2 not tex", '$\\cos(A)$'])
tex = pd.DataFrame(
{'x': np.arange(2020, 2025, dtype=int),
'b': np.random.random(5),
'a1': [f'$x^{i}$' for i in range(5,10)],
'a2': [f'$\\sin({i}x\\pi/n)$' for i in range(5,10)],
'a3': [f'$x^{i}$' for i in range(5,10)],
'a4': [f'\\(x^{i}\\)' for i in range(5,10)],
}).set_index('x')
tex = tex.head()
tex.columns = index
tex
Table 6: (Quarto generated caption): table displayed by default routine.
A B $C_1$ C_2 not tex $\cos(A)$
x
2020 0.718196 $x^5$ $\sin(5x\pi/n)$ $x^5$ \(x^5\)
2021 0.287288 $x^6$ $\sin(6x\pi/n)$ $x^6$ \(x^6\)
2022 0.591513 $x^7$ $\sin(7x\pi/n)$ $x^7$ \(x^7\)
2023 0.697237 $x^8$ $\sin(8x\pi/n)$ $x^8$ \(x^8\)
2024 0.774233 $x^9$ $\sin(9x\pi/n)$ $x^9$ \(x^9\)
Code
sGT(tex, 'GT Caption')
Table 7: GT output (Quarto generated caption)
GT Caption
x A B \(C_1\) C_2 not tex \(\cos(A)\)
2020 0.71820 \(x^5\) \(\sin(5x\pi/n)\) \(x^5\) \(x^5\)
2021 0.28729 \(x^6\) \(\sin(6x\pi/n)\) \(x^6\) \(x^6\)
2022 0.59151 \(x^7\) \(\sin(7x\pi/n)\) \(x^7\) \(x^7\)
2023 0.69724 \(x^8\) \(\sin(8x\pi/n)\) \(x^8\) \(x^8\)
2024 0.77423 \(x^9\) \(\sin(9x\pi/n)\) \(x^9\) \(x^9\)

Ratio columns.

Code
tex.columns = ["A (%)", "B", "$C_1$", "C_2 not tex", '$\\cos(A)$']
sGT(tex, 'Ratio columns in A', ratio_cols='A (%)')
Table 8: greater table output
Ratio columns in A
x A (%) B \(C_1\) C_2 not tex \(\cos(A)\)
2020 71.8% \(x^5\) \(\sin(5x\pi/n)\) \(x^5\) \(x^5\)
2021 28.7% \(x^6\) \(\sin(6x\pi/n)\) \(x^6\) \(x^6\)
2022 59.2% \(x^7\) \(\sin(7x\pi/n)\) \(x^7\) \(x^7\)
2023 69.7% \(x^8\) \(\sin(8x\pi/n)\) \(x^8\) \(x^8\)
2024 77.4% \(x^9\) \(\sin(9x\pi/n)\) \(x^9\) \(x^9\)

3 Greater_tables Test Suite

Code
test_gen = gtu.TestDFGenerator(0, 0)
ans = test_gen.test_suite()    

3.1 Test Table: basic

Code
hrw = (0, 0, 0)
sGT(ans['basic'], "Basic", ratio_cols='z', aligners={'w': 'l'},
        hrule_widths=hrw)
Table 9: GT output for test table basic
Basic
finally debug date enemy float orphans float protruding float prudent datetime shale int slowness int suing int
7,854 2030-06-26 2.11142 12.589k 446.533k 2030-10-26 -2,420 9,789 -8,700
16,196 2007-03-20 0.00302 5.064 18.008M 2018-07-08 1,085 793 1,370
17,925 2029-07-20 0.00003 27.621k 396.221M 2027-09-17 -5,360 -4,847 -1,221
45,007 2025-06-05 0.02476 7.990M 24.956M 2030-10-26 -3,247 622 4,761
46,597 2010-11-11 0.00000 338.592M 182.695M 2020-06-21 9,321 -2,519 9,025
65,875 2009-12-15 0.00029 7.152G 35.381M 2030-10-26 2,489 -8,288 -3,648
73,836 2025-06-05 0.00000 290.625k 1.063M 2022-02-01 -312 -9,006 8,417
79,324 2016-02-07 0.00001 966.832k 109.231M 2030-08-26 4,735 -5,085 -9,105
88,049 2016-10-20 0.00000 4.929G 31.366k 2024-06-27 -5,858 -1,554 -5,719
89,951 2010-11-11 0.00000 6.406G 46.693M 2024-06-27 -7,444 6,314 -2,130

Comments go here.

3.2 Test Table: timeseries

Code
hrw = (0, 0, 0)
sGT(ans['timeseries'], "Timeseries", ratio_cols='z', aligners={'w': 'l'},
        hrule_widths=hrw)
Table 10: GT output for test table timeseries
Timeseries
hour Aghast Forth Recast float Borderline Comprehension Quicksand float Reads Touch Cluck date
2006-06-14 0.00063 5.086M 2016-01-16
2008-01-22 0.00189 135.050k 2018-06-16
2011-07-24 0.00006 674.425k 2026-01-30
2014-02-20 0.00025 32.013 2026-01-30
2015-07-22 0.00000 2.034k 2026-01-30
2017-03-13 0.87787 291.515k 2029-11-24
2017-05-28 0.00340 14.176k 2019-08-15
2017-09-02 0.01595 4.440k 2026-01-30
2018-06-30 0.00000 877.971m 2012-05-30
2018-10-09 0.43277 2.863G 2022-08-10
2019-06-18 0.00203 77.727M 2020-10-20
2019-06-27 0.00051 22.672 2007-01-02
2020-04-14 0.00000 118.617k 2016-01-16
2025-03-13 0.02163 167.999m 2019-08-15
2027-10-01 0.06213 4.350 2007-01-02
2027-11-09 0.00000 169.960 2020-10-20
2029-02-14 0.00000 376.827k 2019-08-15
2031-01-04 0.00030 1.146k 2025-05-23
2031-04-21 0.00000 3.568k 2025-02-09
2033-06-10 0.04446 63.823k 2012-05-30

Comments go here.

3.3 Test Table: multiindex

Code
hrw = (1.5, 1.0, 0.5)
sGT(ans['multiindex'], "Multiindex", ratio_cols='z', aligners={'w': 'l'},
        hrule_widths=hrw)
Table 11: GT output for test table multiindex
Multiindex
subcontractors omniscient dope Clutch Potent Proxies int Coloration Brains Trimester datetime Homicide Mangrove Medicaid float Mulled Mall Overturned float Viability Cannon Reaffirmed int
41,778 nurtured 4,716 737,371,246 2006-07-28 318.230n 0.00000 5,631
11,541 628,029,563 2028-05-19 115.862n 0.00242 -2,675
39,040 952,951,440 2030-08-28 4.728u 0.00000 -8,399
operational 85,483 406,112,420 2030-08-28 12.120n 0.00000 -5,313
99,029 250,843,907 2030-08-28 2.035n 0.00310 -8,481
91,316 nurtured 11,583 83,924,662 2030-08-28 51.575n 0.00000 4,604
15,228 164,891,408 2007-03-31 1.860m 0.00000 9,813
93,958 558,988,229 2009-11-18 1.924n 0.03481 -4,138
operational 11,208 395,204,191 2021-06-25 1.513m 0.22696 2,835
scratches 14,298 579,583,091 2030-08-28 2.781u 0.00002 -2,621

Comments go here.

3.4 Test Table: multicolumns

Code
hrw = (0, 0, 0)
sGT(ans['multicolumns'], "Multicolumns", ratio_cols='z', aligners={'w': 'l'},
        hrule_widths=hrw)
Table 12: GT output for test table multicolumns
Multicolumns
guilty spying
shadows monitored revel shadows
influenza commenting redirected vowels debugging explode
16,750 utilizes 2019-01-03 0.00000 93.987k 2024-02-20
34,377 thoroughness 2013-01-15 0.00023 3.075M 2010-05-22
44,533 uprisings 2029-11-29 0.00000 38.750k 2016-05-25
54,472 critter 2014-06-25 0.00038 9.971k 2031-10-04
64,171 destiny 2029-11-29 0.09353 1.720G 2030-03-12
71,922 savvy 2025-04-20 0.00000 5.788k 2010-05-22
79,803 alright 2013-01-15 0.00001 356.950M 2031-10-04
87,194 solidifies 2013-08-01 0.00009 1.301k 2030-12-05
90,818 acquires 2014-06-25 0.00000 32.788 2031-10-31
94,143 fines 2014-06-25 0.13375 5.077 2031-10-04

Comments go here.

3.5 Test Table: complex

Code
hrw = (1.5, 1.0, 0.5)
sGT(ans['complex'], "Complex", ratio_cols='z', aligners={'w': 'l'},
        hrule_widths=hrw)
Table 13: GT output for test table complex
Complex
partitioning perturbed
cried recoil saddened cried recoil saddened
nines riches creative merciless quirks unconstrained desegregation freezer queue racetrack radiological substances locked
51,924 inventions 10,331 2.623M 0.00000 2013 2016 -950.847p 18.245k 183.787M 1997 0.26346 2020-03-08
27,378 5.630G 0.56872 2027 2005 -8.399m 14.163M 3.408k 2019 0.00001 2021-10-05
33,898 780.044M 0.64145 1995 2007 434.460k 6.827k 50.624k 2024 0.63319 2030-01-16
92,471 40.028k 0.00008 1998 2021 -0.103y 30.670 39.138M 2003 0.00000 2008-02-13
nuclear 9,425 81.988M 0.00000 2002 2000 -277.700Z 7.089 159.617M 2027 1.23574 2015-03-08
14,347 24.193k 0.01225 2026 2022 -64.380n 136.721k 107.424 1999 0.00037 2015-03-08
62,320 2.147M 0.00000 2016 2028 40.642M 292.944 1.390G 2008 0.00000 2030-07-09
repudiate 79,676 1.807G 0.00000 2022 2005 3.843Z 12.544k 1.814k 1997 0.00000 2008-02-13
54,240 inventions 10,825 356.156 0.37059 2002 2024 -8.059Z 369.243m 264.911k 2009 0.00197 2022-12-26
21,803 210.024 0.19573 2016 2011 1066900.627Y 22.193k 4.962G 1993 0.00000 2012-03-17
96,698 7.274G 0.00046 2020 1995 -2.932a 1.422k 853.603M 2021 0.00453 2015-08-06
nuclear 47,064 3.393G 0.02470 1996 2003 -0.000y 26.800 371.147k 2003 0.00000 2020-03-08
82,929 23.345 0.00162 2004 2017 -337.974P 1.629G 63.656M 2029 0.00009 2030-07-09
repudiate 27,297 152.824 0.02037 1998 2013 11177879989333.562Y 64.290k 12.063M 2009 0.00000 2021-10-05
38,293 60.465M 3.24345 2002 2017 4.351Y 781.098M 2.664 2004 0.00000 2015-08-06
43,065 203.428 0.00459 2022 2028 -47.829P 1.409M 473.835M 1995 0.00215 2020-03-08
53,192 131.611 0.00000 1995 2003 9.008P 3.915G 10.812M 2024 0.00056 2026-05-02
56,629 9.537G 0.00842 1994 1994 -0.000y 6.550k 805.653k 2006 0.03449 2011-01-10
69,244 1.787 0.00000 2010 2007 3.397 267.352M 3.369M 2026 0.00001 2020-03-08
82,911 30.563k 0.00002 2021 2017 -0.000y 30.860k 42.570 2026 0.00000 2029-07-23

Comments go here.

4 Other input formats

4.1 Markown

Insured group or insurance product Sat RP RF
Non-standard auto x
General liability for judgment proof corporation x
Term life insurance x
Catastrophe Reinsurance, outside rating agency bounds x
High limit property per risk reinsurance x
Personal lines for affluent individuals x x
Small commercial lines x x
Catastrophe reinsurance, within rating agency bounds x x
Large account captive reinsurance x
Structured quota share, requiring a risk transfer test x x
Working layer casualty excess of loss x x
Surplus relief quota share on cat exposed line x x x
Middle market commercial lines work comp or commercial auto x x x
Code
txt = '''

| **Insured group or insurance product**                      | **Sat** | **RP** | **RF** |
|:------------------------------------------------------------|:-------:|:------:|:------:|
| Non-standard auto                                           |    x    |        |        |
| General liability for judgment proof corporation            |    x    |        |        |
| Term life insurance                                         |         |   x    |        |
| Catastrophe Reinsurance, outside rating agency bounds       |         |   x    |        |
| High limit property per risk reinsurance                    |         |   x    |        |
| Personal lines for affluent individuals                     |    x    |   x    |        |
| Small commercial lines                                      |    x    |   x    |        |
| Catastrophe reinsurance, within rating agency bounds        |    x    |   x    |        |
| Large account captive reinsurance                           |         |        |   x    |
| Structured quota share, requiring a risk transfer test      |    x    |        |   x    |
| Working layer casualty excess of loss                       |         |   x    |   x    |
| Surplus relief quota share on cat exposed line              |    x    |   x    |   x    |
| Middle market commercial lines work comp or commercial auto |    x    |   x    |   x    |


'''

GT(txt)
Table 14: GT from markdown table input
Insured group or insurance product Sat RP RF
Non-standard auto x
General liability for judgment proof corporation x
Term life insurance x
Catastrophe Reinsurance, outside rating agency bounds x
High limit property per risk reinsurance x
Personal lines for affluent individuals x x
Small commercial lines x x
Catastrophe reinsurance, within rating agency bounds x x
Large account captive reinsurance x
Structured quota share, requiring a risk transfer test x x
Working layer casualty excess of loss x x
Surplus relief quota share on cat exposed line x x x
Middle market commercial lines work comp or commercial auto x x x

4.2 List of lists

Code
lol = [['a', 'b', 'c', 'd'], ['west', 10, 20, 30], ['east', 10, 200, 30], ['north', 10, 20, 300], ['south', 100, 20, 30]]
GT(lol)
Table 15: GT output for list of lists input
a b c d
west 10 20 30
east 10 200 30
north 10 20 300
south 100 20 30