Skip to content

ExcelWriteOptions(sheet=None) Source

Settings of an Excel file written by Table.to_excel.

Added in version 0.1.0

Parameters:

  • sheet (str | None, default: None)

    The name of the written sheet, "Sheet1" when omitted.

Raises:

  • InvalidTypeError

    When a setting is not of the type its annotation names.

  • InvalidSheetNameError

    When the name is empty, longer than 31 characters, or holds [ ] : * ? / \, which Excel refuses.

Examples:

import tempfile
from pathlib import Path
import numdaplot as ndp

path = Path(tempfile.mkdtemp()) / "sales.xlsx"
prices = ndp.Table.from_arrays({"price": ndp.Array.from_list([1.5])})
prices.to_excel(path, ndp.ExcelWriteOptions(sheet="Sales"))
ndp.Table.from_excel(path, ndp.ExcelReadOptions(sheet="Sales"))
#     price
#   FLOAT64
# 0     1.5