Output

Print to screen

Functions for printing to screen in a nice format.

tabledataextractor.output.print.as_string(table)[source]

Returns table as string for printing.

Parameters:table (numpy.array) – input numpy array
Returns:string
tabledataextractor.output.print.list_as_PrettyTable(table_list)[source]

Turns list into PrettyTable object, ready for printing.

Parameters:table_list – list to be printed
Returns:table as PrettyTable
tabledataextractor.output.print.print_table(table)[source]

Prints a table to screen.

Parameters:table (numpy.array) – input numpy array for printing

Save to file

Outputs the table to cvs.

tabledataextractor.output.to_csv.write_to_csv(table, file_path)[source]

Writes a numpy array table to a .csv file. Overrides existing files.

Parameters:
  • table (ndarray) – Array of table data
  • file_path (str) – Output location

Convert to Pandas DataFrame

Outputs the table to a Pandas DataFrame.

tabledataextractor.output.to_pandas.build_category_table(df)[source]

Builds the category table in form of a Python list, from Pandas DataFrame input

Parameters:df (pandas.DataFrame) – Pandas DataFrame input
Returns:category_table as Python list
tabledataextractor.output.to_pandas.find_multiindex_level(row_number, column_number, df)[source]

Helping function for _build_category_table(). Finds the Pandas MultiIndex level in a given Pandas DataFrame, for a particular data value.

tabledataextractor.output.to_pandas.print_category_table(df)[source]

Prints the category table to screen, from Pandas DataFrame input

Parameters:df (pandas.DataFrame) – Pandas DataFrame input
tabledataextractor.output.to_pandas.to_pandas(table)[source]

Creates a Pandas DataFrame object from a Table object.

Parameters:table (Table) – Input table
Returns:pandas.DataFrame