Class table#
Defined in File Latex.py
Class Documentation#
- class table#
This class is used to create the text needed for latex tables.
Public Static Functions
- SimpleTable(npt.NDArray arrIn, str form="%.4E", Optional[list[str]] colHeader=None, Optional[list[str]] rowHeader=None)#
This function creates a simple latex table for the 2D numpy array arrIn. The "form" argument specifies the number format to be used in the tabular environment. The "colHeader" arugment is a list of strings that are used as the first row in the tabular environment. The "rowHeader" argument is a list of strings that are used in the first column of each row in the tabular environment. The latex tabular environment is returned as a string. Parameters ---------- arrIn : NDArray Array to convert to Latex table. form : str, optional Format string for the table numbers. (Default value = "%.4E") colHeader : Optional[list[str]] List of strings that form the column headers. (Default value = None) rowHeader : Optional[list[str]] List of strings to use as the row headers. (Default value = None) Returns ------- table : str Latex table as a string.
Protected Static Functions
- _Header(int numCols)#
This function creates the table header based on the number of columns. Parameters ---------- numCols : int Number of columns in the table Returns ------- strOut : str Table header
- _colHeader(list[str] strIn)#
This function creates the column header based on the list of strings that are passed in via the input strIn. Parameters ---------- strIn : list[str] List of strings that form the column headers. Returns ------- strOut : str Column header
- _Arr2Tab(npt.NDArray arrIn, str form="%.4E", Optional[list[str]] rowHeader=None)#
This function transforms the 2-D numpy array (arrIn) into latex tabular format. The "form" argument specifies the number format to be used in the tabular environment. The "rowHeader" argument is a list of strings that are used in the first column of each row in the tabular environment. The latex tabular environment is returned as a string. Parameters ---------- arrIn : NDArray Array to convert to Latex table. form : str, optional Format string for the table numbers. (Default value = "%.4E") rowHeader : Optional[list[str]] List of strings to use as the row headers. (Default value = None) Returns ------- strOut : str Array formatted as a latex table.
This function creates the footer for the latex table.