<jupyter_start><jupyter_text>Filter by number of words<jupyter_code>import pandas as pd

from accessory import word_counter

pd.options.mode.chained_assignment = None
df = pd.read_pickle('english_verified_20201116.pkl')<jupyter_output><empty_output><jupyter_text>Add `cvr` column<jupyter_code>df['cvr'] = df.cr.round(14)<jupyter_output><empty_output><jupyter_text>Filter<jupyter_code>dff = df[['text', 'language', 'views', 'conversions', 'cvr']]<jupyter_output><empty_output><jupyter_text>Add `words` column<jupyter_code>dff['words'] = dff.text.apply(word_counter)<jupyter_output><empty_output><jupyter_text>Filter by number of words<jupyter_code>dff = dff[dff.words >= 100]<jupyter_output><empty_output><jupyter_text>Save to pickle file<jupyter_code>dff.to_pickle('min_100_words_20201116.pkl')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1383495145631068, 'fraction_numerical': 0.02912621359223301, 'mean_word_length': 13.473684210526315, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 26, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '154979', 'license': 'Unlicense', 'n_tokens_mistral': 352, 'n_tokens_neox': 331, 'n_words': 36, 'path': 'jupyter_notebooks/0006_filter_by_words_num.ipynb', 'repo_name': 'korniichuk/phd', 'size': '824'}