Skip to content

Commit

Permalink
more description
Browse files Browse the repository at this point in the history
  • Loading branch information
Polkas committed Dec 23, 2023
1 parent 41137bd commit 65a5041
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cat2cat/cat2cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def cat2cat(
`mappings.trans` arg columns and the `data.cat_var` column have to be of the same type.
When ml part is applied then `ml.cat_var` has to have the same type too.
Changes have to be made at the same time for the mapping table and datasets.
Missing values in the mapping table or categorical variable can cause problems.
3. Missing values in the mapping table or categorical variable can cause problems.
It is recommended to use string or float types in the mapping table and for categorical variable.
Alternative solution can be representing missing values as a specific number (9999) or string ("Missing").
>>> from cat2cat import cat2cat
>>> from cat2cat.dataclass import cat2cat_data, cat2cat_mappings, cat2cat_ml
Expand Down
2 changes: 1 addition & 1 deletion src/cat2cat/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_mappings(x: Table) -> Dict[str, Dict[Any, List[Any]]]:
Note:
There was made an effort to handle missings properly but please try to avoid of using NaN or None.
It is recommended to use string or float types.
Alternative solution can be representing missing values as a specific number (9999) or string ("Missing").
>>> from cat2cat.mappings import get_mappings
>>> from numpy import array, nan
Expand Down

0 comments on commit 65a5041

Please sign in to comment.