Skip to content

Commit 43bfc05

Browse files
committed
docs: replace word factor with categorical
1 parent cb119fd commit 43bfc05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/articles/customize-pins-metadata.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ some_cat = pd.Categorical(["a", "a", "b", "c"])
6565
pin_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}
7373
board.pin_read("some-cat")
@@ -82,12 +82,12 @@ board.pin_meta("some-cat")
8282
This 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

9393
For an example of how this approach is used in a real project, look at how

0 commit comments

Comments
 (0)