From 40d56f3c43ab266b3f0a92f32eb9793cf76453a7 Mon Sep 17 00:00:00 2001 From: rich-iannone Date: Wed, 1 Nov 2023 19:25:30 +0000 Subject: [PATCH] deploy: a78df1c1f2de92925f0fd835d5de5fbd69e7adb3 --- examples-qmd/fmt-number.html | 2 +- examples-qmd/table-manipulation.html | 2 +- search.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples-qmd/fmt-number.html b/examples-qmd/fmt-number.html index 8553ce1ac..3fa4c4cac 100644 --- a/examples-qmd/fmt-number.html +++ b/examples-qmd/fmt-number.html @@ -697,7 +697,7 @@ 2 1154638713 1240613620 1322866505 1396387127 4 295516599 309327143 320738994 331511512 1 228805144 244016173 259091970 271857970 -3 174372098 194454498 210969298 227196741 , _body=<great_tables._gt_data.Body object at 0x7f652c3cff70>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f652c47b370>, <great_tables._gt_data.ColInfo object at 0x7f652c47b3d0>, <great_tables._gt_data.ColInfo object at 0x7f652c47b730>, <great_tables._gt_data.ColInfo object at 0x7f652c47a8c0>, <great_tables._gt_data.ColInfo object at 0x7f652c47ad40>, <great_tables._gt_data.ColInfo object at 0x7f652c47a950>, <great_tables._gt_data.ColInfo object at 0x7f652c47b430>, <great_tables._gt_data.ColInfo object at 0x7f652c47b220>, <great_tables._gt_data.ColInfo object at 0x7f652c47bd00>, <great_tables._gt_data.ColInfo object at 0x7f652c47a9b0>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f652c47b160>, _heading=<great_tables._gt_data.Heading object at 0x7f652c47a890>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f652c47b190>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f652c47af20>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f652c47ada0>, _styles=<great_tables._gt_data.Styles object at 0x7f652c47bcd0>, _locale=<great_tables._gt_data.Locale object at 0x7f652c47bd60>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f652c2c4160>, <great_tables._gt_data.FormatInfo object at 0x7f652c2c42b0>], _options=<great_tables._gt_data.Options object at 0x7f652c47bbe0>, _has_built=False) +3 174372098 194454498 210969298 227196741 , _body=<great_tables._gt_data.Body object at 0x7f898810bc70>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f898816f370>, <great_tables._gt_data.ColInfo object at 0x7f898816f3d0>, <great_tables._gt_data.ColInfo object at 0x7f898816f730>, <great_tables._gt_data.ColInfo object at 0x7f898816e8c0>, <great_tables._gt_data.ColInfo object at 0x7f898816ed40>, <great_tables._gt_data.ColInfo object at 0x7f898816f2e0>, <great_tables._gt_data.ColInfo object at 0x7f898816f430>, <great_tables._gt_data.ColInfo object at 0x7f898816f220>, <great_tables._gt_data.ColInfo object at 0x7f898816fd00>, <great_tables._gt_data.ColInfo object at 0x7f898816e9b0>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f898816f160>, _heading=<great_tables._gt_data.Heading object at 0x7f898816e890>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f898816f190>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f898816ef20>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f898816eda0>, _styles=<great_tables._gt_data.Styles object at 0x7f898816fcd0>, _locale=<great_tables._gt_data.Locale object at 0x7f898816fd60>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f8979f28160>, <great_tables._gt_data.FormatInfo object at 0x7f8979f282b0>], _options=<great_tables._gt_data.Options object at 0x7f898816fbe0>, _has_built=False)

In a variation of the previous table, we can combine large-number suffixing with a declaration of the number of significant digits to use. With things like population figures, n_sigfig=3 is a very good option.

diff --git a/examples-qmd/table-manipulation.html b/examples-qmd/table-manipulation.html index 4089a3060..f89b872e1 100644 --- a/examples-qmd/table-manipulation.html +++ b/examples-qmd/table-manipulation.html @@ -188,7 +188,7 @@ 1 Ferrari 458 Speciale 291744 2 Ferrari 458 Spider 263553 3 Ferrari 458 Italia 233509 -4 Ferrari 488 GTB 245400, _body=<great_tables._gt_data.Body object at 0x7f9ce414d1b0>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f9ce414c640>, <great_tables._gt_data.ColInfo object at 0x7f9ce414cb20>, <great_tables._gt_data.ColInfo object at 0x7f9ce414ca30>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f9ce414d210>, _heading=<great_tables._gt_data.Heading object at 0x7f9ce414d360>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f9ce414c520>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f9ce414d1e0>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f9ce414d480>, _styles=<great_tables._gt_data.Styles object at 0x7f9ce414d6c0>, _locale=<great_tables._gt_data.Locale object at 0x7f9ce414d6f0>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f9ce41655a0>], _options=<great_tables._gt_data.Options object at 0x7f9ce414d690>, _has_built=False) +4 Ferrari 488 GTB 245400, _body=<great_tables._gt_data.Body object at 0x7f7720528eb0>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f7720528a00>, <great_tables._gt_data.ColInfo object at 0x7f7720528a30>, <great_tables._gt_data.ColInfo object at 0x7f77205283a0>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f7720528f10>, _heading=<great_tables._gt_data.Heading object at 0x7f7720529060>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f7720528b80>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f7720528ee0>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f7720529180>, _styles=<great_tables._gt_data.Styles object at 0x7f77205293c0>, _locale=<great_tables._gt_data.Locale object at 0x7f77205293f0>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f77205412a0>], _options=<great_tables._gt_data.Options object at 0x7f7720529390>, _has_built=False)
diff --git a/search.json b/search.json index 9d614a16f..c0bc66cee 100644 --- a/search.json +++ b/search.json @@ -221,14 +221,14 @@ "href": "examples-qmd/fmt-number.html", "title": "great_tables", "section": "", - "text": "import great_tables as gt\nfrom great_tables import exibble, countrypops\n\nUse the exibble dataset to create a gt table. With the fmt_number() method, we’ll format the num column to have three decimal places (with decimals=3) and omit the use of digit separators (with use_seps=False).\n\ngt.GT(exibble).fmt_number(columns='num', decimals=3).cols_label(char = \"character\")\n\n/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/great_tables/_tbl_data.py:142: SettingWithCopyWarning: \nA value is trying to be set on a copy of a slice from a DataFrame\n\nSee the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n data[column][row] = value\n\n\n\n\n\n\n\n\n\nnum\ncharacter\nfctr\ndate\ntime\ndatetime\ncurrency\nrow\ngroup\n\n\n\n\n0.111\napricot\none\n2015-01-15\n13:35\n2018-01-01 02:22\n49.95\nrow_1\ngrp_a\n\n\n2.222\nbanana\ntwo\n2015-02-15\n14:40\n2018-02-02 14:33\n17.95\nrow_2\ngrp_a\n\n\n33.330\ncoconut\nthree\n2015-03-15\n15:45\n2018-03-03 03:44\n1.39\nrow_3\ngrp_a\n\n\n444.400\ndurian\nfour\n2015-04-15\n16:50\n2018-04-04 15:55\n65100.0\nrow_4\ngrp_a\n\n\n5,550.000\nnan\nfive\n2015-05-15\n17:55\n2018-05-05 04:00\n1325.81\nrow_5\ngrp_b\n\n\nnan\nfig\nsix\n2015-06-15\nnan\n2018-06-06 16:11\n13.255\nrow_6\ngrp_b\n\n\n777,000.000\ngrapefruit\nseven\nnan\n19:10\n2018-07-07 05:22\nnan\nrow_7\ngrp_b\n\n\n8,880,000.000\nhoneydew\neight\n2015-08-15\n20:20\nnan\n0.44\nrow_8\ngrp_b\n\n\n\n\n\n\n \n\n\nUse a modified version of the countrypops dataset to create a gt table with row labels. Format all columns to use large-number suffixing (e.g., where '10,000,000' becomes '10M') with the suffixing=True option.\n\nfrom siuba import *\nres = (countrypops\n >> select(_.country_code_3, _.year, _.population)\n >> filter(_.country_code_3.isin(['CHN', 'IND', 'USA', 'PAK', 'IDN']))\n >> filter(_.year > 1975, _.year % 5 == 0)\n >> spread(_.year, _.population)\n >> arrange(-_[2015])\n)\n\n# TODO: implement `suffixing`\n(gt.GT(res)\n .fmt_integer(columns=1980, scale_by=1/10000)\n .fmt_number(columns=1985)\n)\n\nTypeError: Invalid value '98124' for dtype Int64\n\n\nGT(_tbl_data= country_code_3 1980 1985 1990 1995 2000 \\\n0 CHN 981235000 1051040000 1135185000 1204855000 1262645000 \n2 IND 696828385 780242084 870452165 964279129 1059633675 \n4 USA 227225000 237924000 249623000 266278000 282162411 \n1 IDN 148177096 165791694 182159874 198140162 214072421 \n3 PAK 80624057 97121552 115414069 133117476 154369924 \n\n 2005 2010 2015 2020 \n0 1303720000 1337705000 1379860000 1411100000 \n2 1154638713 1240613620 1322866505 1396387127 \n4 295516599 309327143 320738994 331511512 \n1 228805144 244016173 259091970 271857970 \n3 174372098 194454498 210969298 227196741 , _body=<great_tables._gt_data.Body object at 0x7f652c3cff70>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f652c47b370>, <great_tables._gt_data.ColInfo object at 0x7f652c47b3d0>, <great_tables._gt_data.ColInfo object at 0x7f652c47b730>, <great_tables._gt_data.ColInfo object at 0x7f652c47a8c0>, <great_tables._gt_data.ColInfo object at 0x7f652c47ad40>, <great_tables._gt_data.ColInfo object at 0x7f652c47a950>, <great_tables._gt_data.ColInfo object at 0x7f652c47b430>, <great_tables._gt_data.ColInfo object at 0x7f652c47b220>, <great_tables._gt_data.ColInfo object at 0x7f652c47bd00>, <great_tables._gt_data.ColInfo object at 0x7f652c47a9b0>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f652c47b160>, _heading=<great_tables._gt_data.Heading object at 0x7f652c47a890>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f652c47b190>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f652c47af20>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f652c47ada0>, _styles=<great_tables._gt_data.Styles object at 0x7f652c47bcd0>, _locale=<great_tables._gt_data.Locale object at 0x7f652c47bd60>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f652c2c4160>, <great_tables._gt_data.FormatInfo object at 0x7f652c2c42b0>], _options=<great_tables._gt_data.Options object at 0x7f652c47bbe0>, _has_built=False)\n\n\nIn a variation of the previous table, we can combine large-number suffixing with a declaration of the number of significant digits to use. With things like population figures, n_sigfig=3 is a very good option.\n\n#countrypops |>\n# dplyr::select(country_code_3, year, population) |>\n# dplyr::filter(country_code_3 %in% c('CHN', 'IND', 'USA', 'PAK', 'IDN')) |>\n# dplyr::filter(year > 1975 & year %% 5 == 0) |>\n# tidyr::spread(year, population) |>\n# dplyr::arrange(desc(`2015`)) |>\n# gt(rowname_col='country_code_3') |>\n# fmt_number(suffixing=True, n_sigfig=3)\n\nThere can be cases where you want to show numbers to a large number of decimal places but also drop the unnecessary trailing zeros for low-precision values. Let’s take a portion of the towny dataset and format the latitude and longitude columns with fmt_number(). We’ll have up to 5 digits displayed as decimal values, but we’ll also unconditionally drop any runs of trailing zeros in the decimal part with drop_trailing_zeros=True.\n\ntowny |>\n dplyr::select(name, latitude, longitude) |>\n dplyr::slice_head(n=10) |>\n gt() |>\n fmt_number(decimals=5, drop_trailing_zeros=True) |>\n # replace -name with [latitude, longitude]\n ## cols_merge(columns=-name, pattern='{1}, {2}') |>\n cols_label(\n name~'Municipality',\n latitude='Location'\n )" + "text": "import great_tables as gt\nfrom great_tables import exibble, countrypops\n\nUse the exibble dataset to create a gt table. With the fmt_number() method, we’ll format the num column to have three decimal places (with decimals=3) and omit the use of digit separators (with use_seps=False).\n\ngt.GT(exibble).fmt_number(columns='num', decimals=3).cols_label(char = \"character\")\n\n/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/great_tables/_tbl_data.py:142: SettingWithCopyWarning: \nA value is trying to be set on a copy of a slice from a DataFrame\n\nSee the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n data[column][row] = value\n\n\n\n\n\n\n\n\n\nnum\ncharacter\nfctr\ndate\ntime\ndatetime\ncurrency\nrow\ngroup\n\n\n\n\n0.111\napricot\none\n2015-01-15\n13:35\n2018-01-01 02:22\n49.95\nrow_1\ngrp_a\n\n\n2.222\nbanana\ntwo\n2015-02-15\n14:40\n2018-02-02 14:33\n17.95\nrow_2\ngrp_a\n\n\n33.330\ncoconut\nthree\n2015-03-15\n15:45\n2018-03-03 03:44\n1.39\nrow_3\ngrp_a\n\n\n444.400\ndurian\nfour\n2015-04-15\n16:50\n2018-04-04 15:55\n65100.0\nrow_4\ngrp_a\n\n\n5,550.000\nnan\nfive\n2015-05-15\n17:55\n2018-05-05 04:00\n1325.81\nrow_5\ngrp_b\n\n\nnan\nfig\nsix\n2015-06-15\nnan\n2018-06-06 16:11\n13.255\nrow_6\ngrp_b\n\n\n777,000.000\ngrapefruit\nseven\nnan\n19:10\n2018-07-07 05:22\nnan\nrow_7\ngrp_b\n\n\n8,880,000.000\nhoneydew\neight\n2015-08-15\n20:20\nnan\n0.44\nrow_8\ngrp_b\n\n\n\n\n\n\n \n\n\nUse a modified version of the countrypops dataset to create a gt table with row labels. Format all columns to use large-number suffixing (e.g., where '10,000,000' becomes '10M') with the suffixing=True option.\n\nfrom siuba import *\nres = (countrypops\n >> select(_.country_code_3, _.year, _.population)\n >> filter(_.country_code_3.isin(['CHN', 'IND', 'USA', 'PAK', 'IDN']))\n >> filter(_.year > 1975, _.year % 5 == 0)\n >> spread(_.year, _.population)\n >> arrange(-_[2015])\n)\n\n# TODO: implement `suffixing`\n(gt.GT(res)\n .fmt_integer(columns=1980, scale_by=1/10000)\n .fmt_number(columns=1985)\n)\n\nTypeError: Invalid value '98124' for dtype Int64\n\n\nGT(_tbl_data= country_code_3 1980 1985 1990 1995 2000 \\\n0 CHN 981235000 1051040000 1135185000 1204855000 1262645000 \n2 IND 696828385 780242084 870452165 964279129 1059633675 \n4 USA 227225000 237924000 249623000 266278000 282162411 \n1 IDN 148177096 165791694 182159874 198140162 214072421 \n3 PAK 80624057 97121552 115414069 133117476 154369924 \n\n 2005 2010 2015 2020 \n0 1303720000 1337705000 1379860000 1411100000 \n2 1154638713 1240613620 1322866505 1396387127 \n4 295516599 309327143 320738994 331511512 \n1 228805144 244016173 259091970 271857970 \n3 174372098 194454498 210969298 227196741 , _body=<great_tables._gt_data.Body object at 0x7f898810bc70>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f898816f370>, <great_tables._gt_data.ColInfo object at 0x7f898816f3d0>, <great_tables._gt_data.ColInfo object at 0x7f898816f730>, <great_tables._gt_data.ColInfo object at 0x7f898816e8c0>, <great_tables._gt_data.ColInfo object at 0x7f898816ed40>, <great_tables._gt_data.ColInfo object at 0x7f898816f2e0>, <great_tables._gt_data.ColInfo object at 0x7f898816f430>, <great_tables._gt_data.ColInfo object at 0x7f898816f220>, <great_tables._gt_data.ColInfo object at 0x7f898816fd00>, <great_tables._gt_data.ColInfo object at 0x7f898816e9b0>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f898816f160>, _heading=<great_tables._gt_data.Heading object at 0x7f898816e890>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f898816f190>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f898816ef20>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f898816eda0>, _styles=<great_tables._gt_data.Styles object at 0x7f898816fcd0>, _locale=<great_tables._gt_data.Locale object at 0x7f898816fd60>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f8979f28160>, <great_tables._gt_data.FormatInfo object at 0x7f8979f282b0>], _options=<great_tables._gt_data.Options object at 0x7f898816fbe0>, _has_built=False)\n\n\nIn a variation of the previous table, we can combine large-number suffixing with a declaration of the number of significant digits to use. With things like population figures, n_sigfig=3 is a very good option.\n\n#countrypops |>\n# dplyr::select(country_code_3, year, population) |>\n# dplyr::filter(country_code_3 %in% c('CHN', 'IND', 'USA', 'PAK', 'IDN')) |>\n# dplyr::filter(year > 1975 & year %% 5 == 0) |>\n# tidyr::spread(year, population) |>\n# dplyr::arrange(desc(`2015`)) |>\n# gt(rowname_col='country_code_3') |>\n# fmt_number(suffixing=True, n_sigfig=3)\n\nThere can be cases where you want to show numbers to a large number of decimal places but also drop the unnecessary trailing zeros for low-precision values. Let’s take a portion of the towny dataset and format the latitude and longitude columns with fmt_number(). We’ll have up to 5 digits displayed as decimal values, but we’ll also unconditionally drop any runs of trailing zeros in the decimal part with drop_trailing_zeros=True.\n\ntowny |>\n dplyr::select(name, latitude, longitude) |>\n dplyr::slice_head(n=10) |>\n gt() |>\n fmt_number(decimals=5, drop_trailing_zeros=True) |>\n # replace -name with [latitude, longitude]\n ## cols_merge(columns=-name, pattern='{1}, {2}') |>\n cols_label(\n name~'Municipality',\n latitude='Location'\n )" }, { "objectID": "examples-qmd/table-manipulation.html", "href": "examples-qmd/table-manipulation.html", "title": "great_tables", "section": "", - "text": "import great_tables as gt\nfrom great_tables import exibble, countrypops, gtcars # , md, html\n\nfrom siuba import *\n\n\nres = gtcars >> select(_.mfr, _.model, _.msrp) >> _.head(5)\n# TODO: Make `md()` work\ngt.GT(res).tab_header(\n title=\"Data listing from **gtcars**\", subtitle=\"`gtcars` is an R dataset\"\n).fmt_number(columns=\"msrp\", decimals=2, scale_by=1 / 10000)\n\nTypeError: Invalid value '44.70' for dtype Int64\n\n\nGT(_tbl_data= mfr model msrp\n0 Ford GT 447000\n1 Ferrari 458 Speciale 291744\n2 Ferrari 458 Spider 263553\n3 Ferrari 458 Italia 233509\n4 Ferrari 488 GTB 245400, _body=<great_tables._gt_data.Body object at 0x7f9ce414d1b0>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f9ce414c640>, <great_tables._gt_data.ColInfo object at 0x7f9ce414cb20>, <great_tables._gt_data.ColInfo object at 0x7f9ce414ca30>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f9ce414d210>, _heading=<great_tables._gt_data.Heading object at 0x7f9ce414d360>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f9ce414c520>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f9ce414d1e0>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f9ce414d480>, _styles=<great_tables._gt_data.Styles object at 0x7f9ce414d6c0>, _locale=<great_tables._gt_data.Locale object at 0x7f9ce414d6f0>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f9ce41655a0>], _options=<great_tables._gt_data.Options object at 0x7f9ce414d690>, _has_built=False)\n\n\n\ngt.GT(exibble.iloc[[4, 3, 7, 1],], groupname_col=\"group\")\n\n\n\n\n\n\n\n\nnum\nchar\nfctr\ndate\ntime\ndatetime\ncurrency\nrow\ngroup\n\n\n\n\n5550.0\nnan\nfive\n2015-05-15\n17:55\n2018-05-05 04:00\n1325.81\nrow_5\ngrp_b\n\n\n8880000.0\nhoneydew\neight\n2015-08-15\n20:20\nnan\n0.44\nrow_8\ngrp_b\n\n\n444.4\ndurian\nfour\n2015-04-15\n16:50\n2018-04-04 15:55\n65100.0\nrow_4\ngrp_a\n\n\n2.222\nbanana\ntwo\n2015-02-15\n14:40\n2018-02-02 14:33\n17.95\nrow_2\ngrp_a\n\n\n\n\n\n\n \n\n\n\nres = gtcars >> select(_.mfr, _.model, _.msrp) >> _.head(5)\n\n# TODO: Make `html()` work\ngt.GT(res).tab_header(\n title=html(\"Data listing from <strong>gtcars</strong>\"),\n subtitle=html(\"From <span style='color:red;'>gtcars</span>\"),\n)" + "text": "import great_tables as gt\nfrom great_tables import exibble, countrypops, gtcars # , md, html\n\nfrom siuba import *\n\n\nres = gtcars >> select(_.mfr, _.model, _.msrp) >> _.head(5)\n# TODO: Make `md()` work\ngt.GT(res).tab_header(\n title=\"Data listing from **gtcars**\", subtitle=\"`gtcars` is an R dataset\"\n).fmt_number(columns=\"msrp\", decimals=2, scale_by=1 / 10000)\n\nTypeError: Invalid value '44.70' for dtype Int64\n\n\nGT(_tbl_data= mfr model msrp\n0 Ford GT 447000\n1 Ferrari 458 Speciale 291744\n2 Ferrari 458 Spider 263553\n3 Ferrari 458 Italia 233509\n4 Ferrari 488 GTB 245400, _body=<great_tables._gt_data.Body object at 0x7f7720528eb0>, _boxhead=Boxhead([<great_tables._gt_data.ColInfo object at 0x7f7720528a00>, <great_tables._gt_data.ColInfo object at 0x7f7720528a30>, <great_tables._gt_data.ColInfo object at 0x7f77205283a0>]), _stub=Stub([RowInfo(rownum_i=0, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=1, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=2, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=3, group_id=None, rowname=None, group_label=None, built=False), RowInfo(rownum_i=4, group_id=None, rowname=None, group_label=None, built=False)]), _row_groups=RowGroups([]), _spanners=<great_tables._gt_data.Spanners object at 0x7f7720528f10>, _heading=<great_tables._gt_data.Heading object at 0x7f7720529060>, _stubhead=<great_tables._gt_data.Stubhead object at 0x7f7720528b80>, _source_notes=<great_tables._gt_data.SourceNotes object at 0x7f7720528ee0>, _footnotes=<great_tables._gt_data.Footnotes object at 0x7f7720529180>, _styles=<great_tables._gt_data.Styles object at 0x7f77205293c0>, _locale=<great_tables._gt_data.Locale object at 0x7f77205293f0>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f77205412a0>], _options=<great_tables._gt_data.Options object at 0x7f7720529390>, _has_built=False)\n\n\n\ngt.GT(exibble.iloc[[4, 3, 7, 1],], groupname_col=\"group\")\n\n\n\n\n\n\n\n\nnum\nchar\nfctr\ndate\ntime\ndatetime\ncurrency\nrow\ngroup\n\n\n\n\n5550.0\nnan\nfive\n2015-05-15\n17:55\n2018-05-05 04:00\n1325.81\nrow_5\ngrp_b\n\n\n8880000.0\nhoneydew\neight\n2015-08-15\n20:20\nnan\n0.44\nrow_8\ngrp_b\n\n\n444.4\ndurian\nfour\n2015-04-15\n16:50\n2018-04-04 15:55\n65100.0\nrow_4\ngrp_a\n\n\n2.222\nbanana\ntwo\n2015-02-15\n14:40\n2018-02-02 14:33\n17.95\nrow_2\ngrp_a\n\n\n\n\n\n\n \n\n\n\nres = gtcars >> select(_.mfr, _.model, _.msrp) >> _.head(5)\n\n# TODO: Make `html()` work\ngt.GT(res).tab_header(\n title=html(\"Data listing from <strong>gtcars</strong>\"),\n subtitle=html(\"From <span style='color:red;'>gtcars</span>\"),\n)" }, { "objectID": "examples-qmd/GT.html",