Skip to content

Commit

Permalink
fix params docs (fingers crossed)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisfogden committed Apr 28, 2024
1 parent e7750da commit 74f0296
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/heavylight/heavytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,17 @@ 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
- all other columns contain keys to lookup
- 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'
Expand Down

0 comments on commit 74f0296

Please sign in to comment.