<jupyter_start><jupyter_text>**将 `arr`转换为2行的2维数组。**- `arr = np.arange(10)`【知识点：数组的操作】- 如何改变数组的形状？  **垂直堆叠数组a和数组b。**- `a = np.arange(10).reshape([2, -1])`- `b = np.repeat(1, 10).reshape([2, -1])`【知识点：数组操作】- 如何垂直叠加两个数组？  将数组a与数组b水平堆叠。- `a = np.arange(10).reshape([2, -1])`- `b = np.repeat(1, 10).reshape([2, -1])`【知识点：数组的操作】- 如何水平叠加两个数组？  **将 `arr`的2维数组按列输出。**- `arr =  np.array([[16, 17, 18, 19, 20],[11, 12, 13, 14, 15],[21, 22, 23, 24, 25],[31, 32, 33, 34, 35],[26, 27, 28, 29, 30]])`【知识点：数组的操作】- 如何访问二维数组的全部元素，并按列输出？  **给定两个随机数组A和B，验证它们是否相等。**- `A = np.random.randint(0,2,5) B = np.random.randint(0,2,5)`【知识点：数组的操作】- np.allclose()  **在给定的numpy数组中找到重复的条目（第二次出现以后），并将它们标记为True。第一次出现应为False。**- `a = np.random.randint(0, 5, 10)`【知识点：数组操作】- 如何在numpy数组中找到重复值？<jupyter_code>import numpy as np
arr = np.arange(10)
print(arr.shape)
arr.shape = (2, 5)
print(arr)
a = np.arange(10).reshape([2, -1])
b = np.repeat(1, 10).reshape([2, -1])
print(a)
print(b)
arr = np.concatenate((a, b), axis=0)
print(arr)
a = np.arange(10).reshape([2, -1])
b = np.repeat(1, 10).reshape([2, -1])
print(a)
print(b)
arr = np.concatenate((a, b), axis=1)
print(arr)
arr =  np.array([
    [16, 17, 18, 19, 20],
    [11, 12, 13, 14, 15],
    [21, 22, 23, 24, 25],
    [31, 32, 33, 34, 35],
    [26, 27, 28, 29, 30]]
)
print(arr)
new_arr = arr.flatten(order='F')
print(new_arr)
A = np.random.randint(0,2,5)
B = np.random.randint(0,2,5)
np.allclose(A, B)
a = np.random.randint(0, 5, 10)
print(a)
u, indices = np.unique(a, return_index=True)
b = np.full(10, True)
b[indices] = False
print(b)<jupyter_output>[1 2 0 3 3 1 0 1 2 4]
[False False False False  True  True  True  True  True False]
{'fraction_non_alphanumeric': 0.24198427102238354, 'fraction_numerical': 0.10828796128251664, 'mean_word_length': 4.703448275862069, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '657526', 'license': 'MIT', 'n_tokens_mistral': 1059, 'n_tokens_neox': 982, 'n_words': 169, 'path': 'notes/20201025-tomo.ipynb', 'repo_name': 'numpyLearningGroup/numpy-learn', 'size': '1653'}