<jupyter_start><jupyter_text>fct_expand<jupyter_code>fct = factor(sample(letters[:3], 20, replace = TRUE))
fct
fct_expand(fct, "d", "e", "f")
fct_expand(fct, letters[:6])<jupyter_output><empty_output><jupyter_text>fct_explicit_na<jupyter_code>f1 = factor(c("a", "a", NA, NA, "a", "b", NA, "c", "a", "c", "b"))
fct_count(f1)
f2 = fct_explicit_na(f1)
fct_count(f2)<jupyter_output><empty_output><jupyter_text>fct_drop<jupyter_code>fct = factor(c("a", "b"), levels = c("a", "b", "c"))
fct
fct_drop(fct)
fct_drop(fct, only = "a")
fct_drop(fct, only = "c")<jupyter_output><empty_output><jupyter_text>fct_unify<jupyter_code>fs = [factor("a"), factor("b"), factor(c("a", "b"))]
fct_unify(fs)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2244039270687237, 'fraction_numerical': 0.012622720897615708, 'mean_word_length': 11.981818181818182, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '332652', 'license': 'MIT', 'n_tokens_mistral': 354, 'n_tokens_neox': 348, 'n_words': 46, 'path': 'docs/notebooks/forcats_lvl_addrm.ipynb', 'repo_name': 'stjordanis/datar', 'size': '713'}