Excel
Excel helpers from annnet.io.excel.
annnet.io.excel
Functions
from_excel
from_excel(
path,
graph=None,
schema="auto",
sheet=None,
default_slice=None,
default_directed=None,
default_weight=1.0,
**kwargs
)
Load an Excel (.xlsx/.xls) file by converting it internally to CSV, then building a graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Path to the Excel file. |
required |
graph
|
AnnNet
|
Existing graph instance. If None, a new one is created. |
None
|
schema
|
('auto', 'edge_list', 'hyperedge', 'incidence', 'adjacency', 'lil')
|
AnnNet schema to assume or infer. |
'auto'
|
sheet
|
str
|
Sheet name to load. Defaults to the first sheet. |
None
|
default_slice
|
str
|
Default slice name if not present. |
None
|
default_directed
|
bool
|
Default directedness if not present or inferrable. |
None
|
default_weight
|
float
|
Default weight if no weight column exists. |
1.0
|
**kwargs
|
Extra keyword arguments passed to the graph constructor. |
{}
|
Returns:
| Type | Description |
|---|---|
AnnNet
|
The created or augmented graph. |
Notes
- Excel reading is centralized through AnnNet's dataframe backend helpers.
- Supported formats and schemas are identical to
from_csv.