@@ -65,9 +65,9 @@ some_cat = pd.Categorical(["a", "a", "b", "c"])
6565pin_write_cat_json(board, some_cat, name = "some-cat")
6666```
6767
68- ## A function to read factors
68+ ## A function to read categoricals
6969
70- It's possible to read this pin using the regular ` pin_read() ` function, but the object we get is no longer a factor !
70+ It's possible to read this pin using the regular ` pin_read() ` function, but the object we get is no longer a categorical !
7171
7272``` {python}
7373board.pin_read("some-cat")
@@ -82,12 +82,12 @@ board.pin_meta("some-cat")
8282This enables us to write a special function for reading, to reconstruct the categorical, using the categories stashed in metadata:
8383
8484``` {python}
85- def pin_read_factor_json (board, name, version=None, hash=None, **kwargs):
85+ def pin_read_cat_json (board, name, version=None, hash=None, **kwargs):
8686 data = board.pin_read(name = name, version = version, hash = hash, **kwargs)
8787 meta = board.pin_meta(name = name, version = version, **kwargs)
8888 return pd.Categorical(data, categories=meta.user["categories"])
8989
90- pin_read_factor_json (board, "some-cat")
90+ pin_read_cat_json (board, "some-cat")
9191```
9292
9393For an example of how this approach is used in a real project, look at how
0 commit comments