From 51991e4342f8d3bc9f59b0853b18694a046c1755 Mon Sep 17 00:00:00 2001 From: evilchili Date: Fri, 22 Dec 2023 21:27:36 -0800 Subject: [PATCH] bugfix --- rolltable/tables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rolltable/tables.py b/rolltable/tables.py index df5f191..3ffa5c4 100644 --- a/rolltable/tables.py +++ b/rolltable/tables.py @@ -87,12 +87,15 @@ class DataSource: ] def as_dict(self) -> dict: + """ + Return the contents of the data source as a dict. + """ data = dict() for name in self.data.keys(): entries = self.get_entries(name, rand=False) headers = self.headers for i in range(0, len(self.headers) - len(entries[0])): - headers.append(f"{i:3f}", i) + headers.append(f"{i:3f}") items = {(k, v) for k, v in zip(self.headers, self.get_entries(name))} print(items) data[name] = dict(items)