environmentaltools.common.xlsx

environmentaltools.common.xlsx(file_name: str, sheet_name: str = 0, names: str = None)[source]

Read Excel file (.xls or .xlsx).

Reads Excel workbook with support for specific sheets and column naming.

Parameters:
  • file_name (str) – Path to Excel file.

  • sheet_name (str or int) – Sheet name or index to read. Defaults to 0 (first sheet).

  • names (list, optional) – Custom column names. Defaults to None (use file headers).

Returns:

Data from specified Excel sheet with first column as index.

Return type:

pd.DataFrame