From 74f0296337c6eccb1a65363618af7981532dddab Mon Sep 17 00:00:00 2001 From: Lewis Fogden Date: Sun, 28 Apr 2024 19:29:29 +0100 Subject: [PATCH] fix params docs (fingers crossed) --- src/heavylight/heavytables.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/heavylight/heavytables.py b/src/heavylight/heavytables.py index e989395..22f5c36 100644 --- a/src/heavylight/heavytables.py +++ b/src/heavylight/heavytables.py @@ -129,8 +129,9 @@ def __init__(self, df:pd.DataFrame, rectify=False, safe=True): """Initialise a table from a dataframe. parameters: - - `rectify`: force table to be rectangular (default False) - - `safe`: validates that integers are between bounds (default True) + `df`: the pandas dataframe used to initialise the table + `rectify`: force table to be rectangular (default False) + `safe`: validates that integers are between bounds (default True) Tables should be in long format: - the final column containing the values to look up @@ -138,7 +139,7 @@ def __init__(self, df:pd.DataFrame, rectify=False, safe=True): - tables should be contingous, i.e. no gaps in integer keys. - tables should be complete if viewed as square matrixes (i.e. all combinations of keys are input). If not, you should fill any gaps with np.nan or a suitable value. - The type of key is determined by the suffix on the column name: + The type of key is determined by the suffix on the dataframe `df` column names: `|int`: integers (...0, 1, 2, 3...), can start and end anywhere, but must be consecutive `|int_bound`: as `|int` but any values are constrained to the lowest and highest values. `|str': keys are interpreted as strings, e.g. 'M' and 'F'