<jupyter_start><jupyter_text>Boolean masking<jupyter_code>filedata > 50
filedata[filedata > 50]
## you can index with a list in numpy
a = np.array([1,2,3,4,5,6,7,8,9])
a[[0,6,8]]
# what columns have a value greater than 50
np.any(filedata > 50, axis = 0)
# where all the coulmns have a value greater than 50 
np.all(filedata > 50, axis = 0)
((filedata > 50)&(filedata < 100))
# excercise question
from IPython.display import Image
Image("Capture.PNG")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13721413721413722, 'fraction_numerical': 0.06444906444906445, 'mean_word_length': 5.788732394366197, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '650978', 'license': 'MIT', 'n_tokens_mistral': 212, 'n_tokens_neox': 184, 'n_words': 52, 'path': 'Numpy Tutorial.ipynb', 'repo_name': 'mahfuz978/TECH-I.S.---DATA-PROCESSING', 'size': '481'}