histopath_bim_des.excel moduleο
Functions for reading Excel data
- histopath_bim_des.excel.get_name(wbook: Workbook, name: str) int | float | str | datetime | list[list[int | float | str | datetime]] [source]ο
Read an Excel named range as a single value or NumPy array. Arrays are flattened if possible.
- Parameters:
wbook β The workbook object.
name β Name of the Excel range to read.
Returns: A single value, or a nested list containing the named rangeβs values.
- histopath_bim_des.excel.get_table(wbook: Workbook, sheet_name: str, name: str) list[list[int | float | str | datetime]] [source]ο
Reads an Excel table as a nested list.
- Parameters:
wbook β The workbook object.
sheet_name β Name of the Excel worksheet containing the table.
name β Name of the Excel table to read.
Returns: A nested list containing the named rangeβs values.
- histopath_bim_des.excel.remove_table_filters(table: Table, ws: Worksheet) None [source]ο
Remove filters from an Excel table.
- Parameters:
table β The table to alter.
ws β The worksheet in which the table is to be inserted.
- histopath_bim_des.excel.write_table(df: DataFrame, path: PathLike, sheet_name: str, name: str) None [source]ο
Writes a pandas DataFrame to an Excel table in a new worksheet, replacing the existing worksheet if found. Note that the index is not used; use df.reset_index(drop=False, names=βidxβ) to include the DataFrame index.
- Parameters:
df β The DataFrame to write.
path β The filepath of the workbook to write to.
sheet_name β The name of the worksheet to write to.
name β The name of the Excel table to create.