mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-08 08:03:13 +00:00
convert node state enum to integer in the DataFrame to minimize the size of CSV file
This commit is contained in:
parent
961c1e7581
commit
0cae56c9b4
@ -24,7 +24,10 @@ class AllNodeStates:
|
||||
def analyze(self):
|
||||
df = pandas.DataFrame(self._table).transpose()
|
||||
df.columns = [f"Node-{i}" for i in range(len(self._table))]
|
||||
# Convert NodeState enum to their integer values for analysis
|
||||
df = df.map(lambda state: state.value)
|
||||
print(df)
|
||||
|
||||
csv_path = f"all_node_states_{datetime.now().isoformat(timespec="seconds")}.csv"
|
||||
df.to_csv(csv_path)
|
||||
print(f"\nSaved DataFrame to {csv_path}\n")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user