Skip to content

Commit 32382c5

Browse files
committed
updated example toexcel.py
1 parent daebeff commit 32382c5

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

epyt/examples/python/EX_to_excel_json.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,24 @@
5757
comp_values.to_excel(f"to_excel_{selected_attribute}_example",
5858
attributes=selected_attribute)
5959

60+
# Retrieve node and link IDs from the network
61+
nodeid = d.getNodeNameID()
62+
linkid = d.getLinkNameID()
63+
64+
# Below are four example scenarios demonstrating how to use comp_values.to_excel()
65+
# with different parameter configurations:
66+
67+
# 1) Scenario 1: Include both index and node/link IDs in the output.
68+
comp_values.to_excel("case1", node_id_list=nodeid, link_id_list=linkid, both=True)
69+
70+
# 2) Scenario 2: Include only node/link IDs (no index).
71+
comp_values.to_excel("case2", node_id_list=nodeid, link_id_list=linkid, both=False)
72+
73+
# 3) Scenario 3: Use the default settings (only index is included).
74+
comp_values.to_excel("case3")
75+
76+
# 4) Scenario 4: Use the default settings but suppress the column headers.
77+
comp_values.to_excel("case4", header=False)
78+
6079
# Unload library
6180
d.unload()

epyt/examples/python/EX_toexcel.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)