<jupyter_start><jupyter_text>[Methods](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.ndarray.html) Import package<jupyter_code>import numpy as np<jupyter_output><empty_output><jupyter_text>Check if all the elements in the NumPy array are True`all(axis)`: 0 for column, 1 for row (default: all elements)<jupyter_code>data = [[True, False, True], [True, False, True]]
np.array(data)
np.array(data).all(0)<jupyter_output><empty_output><jupyter_text>Check if any of the elements in the NumPy array is True`any(axis)`: 0 for column, 1 for row (default: all elements)<jupyter_code>np.array(data).any(1)<jupyter_output><empty_output><jupyter_text>Return the indices of the maximum or minimum value in the NumPy array`argmax(axis)`, `argmin(axis)`0 for column, 1 for row (default: all elements)<jupyter_code>data = [[10, 5, 15], [3, 9, 6]]
np.array(data)
np.array(data).argmax()
np.array(data).argmax(0)
np.array(data).argmin(1)<jupyter_output><empty_output><jupyter_text>Return the indices which sort the NumPy array`argsort(axis)`: 0 for column, 1 for row (default)<jupyter_code>np.array(data).argsort()<jupyter_output><empty_output><jupyter_text>Sort NumPy array`sort(axis)`: 0 for column, 1 for row (default)warning: this function will not return a new array<jupyter_code>a = np.array([[15, 5, 10], [9, 6, 3]])
a.sort()
a<jupyter_output><empty_output><jupyter_text>Change the data type of the NumPy array`astype(data_type)`<jupyter_code>np.array([1.0, 2.5, 3.0]).astype(np.int16)<jupyter_output><empty_output><jupyter_text>Return the copy of the NumPy array`copy()`<jupyter_code>np.array([1, 2, 3]).copy()<jupyter_output><empty_output><jupyter_text>Return the transpose of the NumPy array`transpose()`<jupyter_code>np.array([[1, 2, 3], [4, 5, 6]]).transpose()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15401662049861495, 'fraction_numerical': 0.028254847645429362, 'mean_word_length': 8.309278350515465, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 1, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '142856', 'license': 'MIT', 'n_tokens_mistral': 728, 'n_tokens_neox': 682, 'n_words': 151, 'path': 'notebooks/methods.ipynb', 'repo_name': 'DachshundSovereign/NumPy-Handbook', 'size': '1805'}