Skip to content

Commit

Permalink
updated example toexcel.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ichrys03 committed Jan 8, 2025
1 parent daebeff commit 32382c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
19 changes: 19 additions & 0 deletions epyt/examples/python/EX_to_excel_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,24 @@
comp_values.to_excel(f"to_excel_{selected_attribute}_example",
attributes=selected_attribute)

# Retrieve node and link IDs from the network
nodeid = d.getNodeNameID()
linkid = d.getLinkNameID()

# Below are four example scenarios demonstrating how to use comp_values.to_excel()
# with different parameter configurations:

# 1) Scenario 1: Include both index and node/link IDs in the output.
comp_values.to_excel("case1", node_id_list=nodeid, link_id_list=linkid, both=True)

# 2) Scenario 2: Include only node/link IDs (no index).
comp_values.to_excel("case2", node_id_list=nodeid, link_id_list=linkid, both=False)

# 3) Scenario 3: Use the default settings (only index is included).
comp_values.to_excel("case3")

# 4) Scenario 4: Use the default settings but suppress the column headers.
comp_values.to_excel("case4", header=False)

# Unload library
d.unload()
13 changes: 0 additions & 13 deletions epyt/examples/python/EX_toexcel.py

This file was deleted.

0 comments on commit 32382c5

Please sign in to comment.