%global _empty_manifest_terminate_build 0 Name: python-tableone Version: 0.8.0 Release: 1 Summary: A small example package License: MIT License Copyright (c) 2017 Tom Pollard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. URL: https://pypi.org/project/tableone/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/dc/bd/a918aabfe8559a9b796022c352b94ab530a099a5c213cd6b6f1be6cf72d4/tableone-0.8.0.tar.gz BuildArch: noarch Requires: python3-jinja2 Requires: python3-numpy Requires: python3-openpyxl Requires: python3-pandas Requires: python3-scipy Requires: python3-statsmodels Requires: python3-tabulate %description # tableone tableone is a package for creating "Table 1" summary statistics for a patient population. It was inspired by the R package of the same name by Yoshida and Bohn. [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.837898.svg)](https://doi.org/10.5281/zenodo.837898) [![Documentation Status](https://readthedocs.org/projects/tableone/badge/?version=latest)](https://tableone.readthedocs.io/en/latest/?badge=latest) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/tableone/badges/version.svg)](https://anaconda.org/conda-forge/tableone) [![PyPI version](https://badge.fury.io/py/tableone.svg)](https://badge.fury.io/py/tableone) ## Suggested citation If you use tableone in your study, please cite the following paper: > Tom J Pollard, Alistair E W Johnson, Jesse D Raffa, Roger G Mark; tableone: An open source Python package for producing summary statistics for research papers, JAMIA Open, [https://doi.org/10.1093/jamiaopen/ooy012](https://doi.org/10.1093/jamiaopen/ooy012) ## Documentation For documentation, see: [http://tableone.readthedocs.io/en/latest/](http://tableone.readthedocs.io/en/latest/). An executable demonstration of the package is available [on GitHub](https://github.com/tompollard/tableone/blob/master/tableone.ipynb) as a Jupyter Notebook. The easiest way to try out this notebook is to [open it in Google Colaboratory](https://colab.research.google.com/github/tompollard/tableone/blob/master/tableone.ipynb). A paper describing our motivations for creating the package is available at: [https://doi.org/10.1093/jamiaopen/ooy012](https://doi.org/10.1093/jamiaopen/ooy012). ## A note for users of `tableone` While we have tried to use best practices in creating this package, automation of even basic statistical tasks can be unsound if done without supervision. We encourage use of `tableone` alongside other methods of descriptive statistics and, in particular, visualization to ensure appropriate data handling. It is beyond the scope of our documentation to provide detailed guidance on summary statistics, but as a primer we provide some considerations for choosing parameters when creating a summary table at: [http://tableone.readthedocs.io/en/latest/bestpractice.html](http://tableone.readthedocs.io/en/latest/bestpractice.html). *Guidance should be sought from a statistician when using `tableone` for a research study, especially prior to submitting the study for publication*. ## Overview At a high level, you can use the package as follows: - Import the data into a pandas DataFrame ![Starting DataFrame ](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/input_data.png "Starting DataFrame") - Run tableone on this dataframe to output summary statistics ![Table 1](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/table1.png "Table 1") - Specify your desired output format: text, latex, markdown, etc. ![Export to LaTex](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/table1_latex.png "Export to LaTex") Additional options include: - Select a subset of columns. - Specify the data type (e.g. `categorical`, `numerical`, `nonnormal`). - Compute p-values, and adjust for multiple testing (e.g. with the Bonferroni correction). - Compute standardized mean differences (SMDs). - Provide a list of alternative labels for variables - Limit the output of categorical variables to the top N rows. - Display remarks relating to the appopriateness of summary measures (for example, computing tests for multimodality and normality). ## Installation To install the package with pip, run: ```pip install tableone``` To install this package with conda, run: ```conda install -c conda-forge tableone``` ## Example usage 1. Import libraries: ```python from tableone import TableOne, load_dataset import pandas as pd ``` 2. Load sample data into a pandas dataframe: ```python data=load_dataset('pn2012') ``` 3. Optionally, a list of columns to be included in Table 1: ```python columns = ['Age', 'SysABP', 'Height', 'Weight', 'ICU', 'death'] ``` 4. Optionally, a list of columns containing categorical variables: ```python categorical = ['ICU', 'death'] ``` 5. Optionally, a categorical variable for stratification, a list of non-normal variables, and a dictionary of alternative labels: ```python groupby = ['death'] nonnormal = ['Age'] labels={'death': 'mortality'} ``` 6. Create an instance of TableOne with the input arguments: ```python mytable = TableOne(data, columns=columns, categorical=categorical, groupby=groupby, nonnormal=nonnormal, rename=labels, pval=False) ``` 7. Display the table using the `tabulate` method. The `tablefmt` argument allows the table to be displayed in multiple formats, including "github", "grid", "fancy_grid", "rst", "html", and "latex". ```python print(mytable.tabulate(tablefmt = "fancy_grid")) ``` 8. ...which prints the following table to screen: Grouped by mortality: | | | Missing | 0 | 1 | | --------- | ------ | -------- | -------------- | -------------- | | n | | | 864 | 136 | | Age | | 0 | 66 [52,78] | 75 [62,83] | | SysABP | | 291 | 115.36 (38.34) | 107.57 (49.43) | | Height | | 475 | 170.33 (23.22) | 168.51 (11.31) | | Weight | | 302 | 83.04 (23.58) | 82.29 (25.40) | | ICU | CCU | 0 | 137 (15.86) | 25 (18.38) | | | CSRU | | 194 (22.45) | 8 (5.88) | | | MICU | | 318 (36.81) | 62 (45.59) | | | SICU | | 215 (24.88) | 41 (30.15) | | mortality | 0 | 0 | 864 (100.0) | | | | 1 | | | 136 (100.0) | 9. Tables can be exported to file in various formats, including LaTeX, CSV, and HTML. Files are exported by calling the ``to_format`` method on the tableone object. For example, mytable can be exported to an Excel spreadsheet named 'mytable.xlsx' with the following command: ```python mytable.to_excel('mytable.xlsx') ``` %package -n python3-tableone Summary: A small example package Provides: python-tableone BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-tableone # tableone tableone is a package for creating "Table 1" summary statistics for a patient population. It was inspired by the R package of the same name by Yoshida and Bohn. [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.837898.svg)](https://doi.org/10.5281/zenodo.837898) [![Documentation Status](https://readthedocs.org/projects/tableone/badge/?version=latest)](https://tableone.readthedocs.io/en/latest/?badge=latest) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/tableone/badges/version.svg)](https://anaconda.org/conda-forge/tableone) [![PyPI version](https://badge.fury.io/py/tableone.svg)](https://badge.fury.io/py/tableone) ## Suggested citation If you use tableone in your study, please cite the following paper: > Tom J Pollard, Alistair E W Johnson, Jesse D Raffa, Roger G Mark; tableone: An open source Python package for producing summary statistics for research papers, JAMIA Open, [https://doi.org/10.1093/jamiaopen/ooy012](https://doi.org/10.1093/jamiaopen/ooy012) ## Documentation For documentation, see: [http://tableone.readthedocs.io/en/latest/](http://tableone.readthedocs.io/en/latest/). An executable demonstration of the package is available [on GitHub](https://github.com/tompollard/tableone/blob/master/tableone.ipynb) as a Jupyter Notebook. The easiest way to try out this notebook is to [open it in Google Colaboratory](https://colab.research.google.com/github/tompollard/tableone/blob/master/tableone.ipynb). A paper describing our motivations for creating the package is available at: [https://doi.org/10.1093/jamiaopen/ooy012](https://doi.org/10.1093/jamiaopen/ooy012). ## A note for users of `tableone` While we have tried to use best practices in creating this package, automation of even basic statistical tasks can be unsound if done without supervision. We encourage use of `tableone` alongside other methods of descriptive statistics and, in particular, visualization to ensure appropriate data handling. It is beyond the scope of our documentation to provide detailed guidance on summary statistics, but as a primer we provide some considerations for choosing parameters when creating a summary table at: [http://tableone.readthedocs.io/en/latest/bestpractice.html](http://tableone.readthedocs.io/en/latest/bestpractice.html). *Guidance should be sought from a statistician when using `tableone` for a research study, especially prior to submitting the study for publication*. ## Overview At a high level, you can use the package as follows: - Import the data into a pandas DataFrame ![Starting DataFrame ](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/input_data.png "Starting DataFrame") - Run tableone on this dataframe to output summary statistics ![Table 1](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/table1.png "Table 1") - Specify your desired output format: text, latex, markdown, etc. ![Export to LaTex](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/table1_latex.png "Export to LaTex") Additional options include: - Select a subset of columns. - Specify the data type (e.g. `categorical`, `numerical`, `nonnormal`). - Compute p-values, and adjust for multiple testing (e.g. with the Bonferroni correction). - Compute standardized mean differences (SMDs). - Provide a list of alternative labels for variables - Limit the output of categorical variables to the top N rows. - Display remarks relating to the appopriateness of summary measures (for example, computing tests for multimodality and normality). ## Installation To install the package with pip, run: ```pip install tableone``` To install this package with conda, run: ```conda install -c conda-forge tableone``` ## Example usage 1. Import libraries: ```python from tableone import TableOne, load_dataset import pandas as pd ``` 2. Load sample data into a pandas dataframe: ```python data=load_dataset('pn2012') ``` 3. Optionally, a list of columns to be included in Table 1: ```python columns = ['Age', 'SysABP', 'Height', 'Weight', 'ICU', 'death'] ``` 4. Optionally, a list of columns containing categorical variables: ```python categorical = ['ICU', 'death'] ``` 5. Optionally, a categorical variable for stratification, a list of non-normal variables, and a dictionary of alternative labels: ```python groupby = ['death'] nonnormal = ['Age'] labels={'death': 'mortality'} ``` 6. Create an instance of TableOne with the input arguments: ```python mytable = TableOne(data, columns=columns, categorical=categorical, groupby=groupby, nonnormal=nonnormal, rename=labels, pval=False) ``` 7. Display the table using the `tabulate` method. The `tablefmt` argument allows the table to be displayed in multiple formats, including "github", "grid", "fancy_grid", "rst", "html", and "latex". ```python print(mytable.tabulate(tablefmt = "fancy_grid")) ``` 8. ...which prints the following table to screen: Grouped by mortality: | | | Missing | 0 | 1 | | --------- | ------ | -------- | -------------- | -------------- | | n | | | 864 | 136 | | Age | | 0 | 66 [52,78] | 75 [62,83] | | SysABP | | 291 | 115.36 (38.34) | 107.57 (49.43) | | Height | | 475 | 170.33 (23.22) | 168.51 (11.31) | | Weight | | 302 | 83.04 (23.58) | 82.29 (25.40) | | ICU | CCU | 0 | 137 (15.86) | 25 (18.38) | | | CSRU | | 194 (22.45) | 8 (5.88) | | | MICU | | 318 (36.81) | 62 (45.59) | | | SICU | | 215 (24.88) | 41 (30.15) | | mortality | 0 | 0 | 864 (100.0) | | | | 1 | | | 136 (100.0) | 9. Tables can be exported to file in various formats, including LaTeX, CSV, and HTML. Files are exported by calling the ``to_format`` method on the tableone object. For example, mytable can be exported to an Excel spreadsheet named 'mytable.xlsx' with the following command: ```python mytable.to_excel('mytable.xlsx') ``` %package help Summary: Development documents and examples for tableone Provides: python3-tableone-doc %description help # tableone tableone is a package for creating "Table 1" summary statistics for a patient population. It was inspired by the R package of the same name by Yoshida and Bohn. [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.837898.svg)](https://doi.org/10.5281/zenodo.837898) [![Documentation Status](https://readthedocs.org/projects/tableone/badge/?version=latest)](https://tableone.readthedocs.io/en/latest/?badge=latest) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/tableone/badges/version.svg)](https://anaconda.org/conda-forge/tableone) [![PyPI version](https://badge.fury.io/py/tableone.svg)](https://badge.fury.io/py/tableone) ## Suggested citation If you use tableone in your study, please cite the following paper: > Tom J Pollard, Alistair E W Johnson, Jesse D Raffa, Roger G Mark; tableone: An open source Python package for producing summary statistics for research papers, JAMIA Open, [https://doi.org/10.1093/jamiaopen/ooy012](https://doi.org/10.1093/jamiaopen/ooy012) ## Documentation For documentation, see: [http://tableone.readthedocs.io/en/latest/](http://tableone.readthedocs.io/en/latest/). An executable demonstration of the package is available [on GitHub](https://github.com/tompollard/tableone/blob/master/tableone.ipynb) as a Jupyter Notebook. The easiest way to try out this notebook is to [open it in Google Colaboratory](https://colab.research.google.com/github/tompollard/tableone/blob/master/tableone.ipynb). A paper describing our motivations for creating the package is available at: [https://doi.org/10.1093/jamiaopen/ooy012](https://doi.org/10.1093/jamiaopen/ooy012). ## A note for users of `tableone` While we have tried to use best practices in creating this package, automation of even basic statistical tasks can be unsound if done without supervision. We encourage use of `tableone` alongside other methods of descriptive statistics and, in particular, visualization to ensure appropriate data handling. It is beyond the scope of our documentation to provide detailed guidance on summary statistics, but as a primer we provide some considerations for choosing parameters when creating a summary table at: [http://tableone.readthedocs.io/en/latest/bestpractice.html](http://tableone.readthedocs.io/en/latest/bestpractice.html). *Guidance should be sought from a statistician when using `tableone` for a research study, especially prior to submitting the study for publication*. ## Overview At a high level, you can use the package as follows: - Import the data into a pandas DataFrame ![Starting DataFrame ](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/input_data.png "Starting DataFrame") - Run tableone on this dataframe to output summary statistics ![Table 1](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/table1.png "Table 1") - Specify your desired output format: text, latex, markdown, etc. ![Export to LaTex](https://raw.githubusercontent.com/tompollard/tableone/master/docs/images/table1_latex.png "Export to LaTex") Additional options include: - Select a subset of columns. - Specify the data type (e.g. `categorical`, `numerical`, `nonnormal`). - Compute p-values, and adjust for multiple testing (e.g. with the Bonferroni correction). - Compute standardized mean differences (SMDs). - Provide a list of alternative labels for variables - Limit the output of categorical variables to the top N rows. - Display remarks relating to the appopriateness of summary measures (for example, computing tests for multimodality and normality). ## Installation To install the package with pip, run: ```pip install tableone``` To install this package with conda, run: ```conda install -c conda-forge tableone``` ## Example usage 1. Import libraries: ```python from tableone import TableOne, load_dataset import pandas as pd ``` 2. Load sample data into a pandas dataframe: ```python data=load_dataset('pn2012') ``` 3. Optionally, a list of columns to be included in Table 1: ```python columns = ['Age', 'SysABP', 'Height', 'Weight', 'ICU', 'death'] ``` 4. Optionally, a list of columns containing categorical variables: ```python categorical = ['ICU', 'death'] ``` 5. Optionally, a categorical variable for stratification, a list of non-normal variables, and a dictionary of alternative labels: ```python groupby = ['death'] nonnormal = ['Age'] labels={'death': 'mortality'} ``` 6. Create an instance of TableOne with the input arguments: ```python mytable = TableOne(data, columns=columns, categorical=categorical, groupby=groupby, nonnormal=nonnormal, rename=labels, pval=False) ``` 7. Display the table using the `tabulate` method. The `tablefmt` argument allows the table to be displayed in multiple formats, including "github", "grid", "fancy_grid", "rst", "html", and "latex". ```python print(mytable.tabulate(tablefmt = "fancy_grid")) ``` 8. ...which prints the following table to screen: Grouped by mortality: | | | Missing | 0 | 1 | | --------- | ------ | -------- | -------------- | -------------- | | n | | | 864 | 136 | | Age | | 0 | 66 [52,78] | 75 [62,83] | | SysABP | | 291 | 115.36 (38.34) | 107.57 (49.43) | | Height | | 475 | 170.33 (23.22) | 168.51 (11.31) | | Weight | | 302 | 83.04 (23.58) | 82.29 (25.40) | | ICU | CCU | 0 | 137 (15.86) | 25 (18.38) | | | CSRU | | 194 (22.45) | 8 (5.88) | | | MICU | | 318 (36.81) | 62 (45.59) | | | SICU | | 215 (24.88) | 41 (30.15) | | mortality | 0 | 0 | 864 (100.0) | | | | 1 | | | 136 (100.0) | 9. Tables can be exported to file in various formats, including LaTeX, CSV, and HTML. Files are exported by calling the ``to_format`` method on the tableone object. For example, mytable can be exported to an Excel spreadsheet named 'mytable.xlsx' with the following command: ```python mytable.to_excel('mytable.xlsx') ``` %prep %autosetup -n tableone-0.8.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-tableone -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 0.8.0-1 - Package Spec generated