Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit a1242ab

Browse files
committed
remove dependency
1 parent 46764e8 commit a1242ab

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

ecml_tools/create/statistics.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from collections import defaultdict
1717

1818
import numpy as np
19-
from prepml.utils.text import table
2019

2120
from ecml_tools.provenance import gather_provenance_info
2221

@@ -274,19 +273,12 @@ def check(self):
274273
raise
275274

276275
def __str__(self):
277-
stats = [self[name] for name in self.STATS_NAMES]
278-
279-
rows = []
276+
header = ["Variables"] + [self[name] for name in self.STATS_NAMES]
277+
out = " ".join(header)
280278

281279
for i, v in enumerate(self["variables_names"]):
282-
rows.append([i, v] + [x[i] for x in stats])
283-
284-
return table(
285-
rows,
286-
header=["Index", "Variable", "Min", "Max", "Mean", "Stdev"],
287-
align=[">", "<", ">", ">", ">", ">"],
288-
margin=3,
289-
)
280+
out += " ".join([v] + [f"{x[i]:.2f}" for x in self.values()])
281+
return out
290282

291283
def save(self, filename, provenance=None):
292284
assert filename.endswith(".json"), filename

0 commit comments

Comments
 (0)