Test whether any array element along a given axis evaluates to True.
print(np.any([]), np.any([1, 2]), np.any(np.nan), np.any(()), np.any(np.array([True, True, True])), np.any(np.array([False, False]))) # res: False True True False True False # 补充:(np.nan == False) 为 False2 ravel()
Return a contiguous flattened array.
a = np.array([[1,2,3], [4,5,6]]) print(a, 'n-----------n', a.ravel()) # res: ''' [[1 2 3] [4 5 6]] ----------- [1 2 3 4 5 6] '''3 concatenate()
Join a sequence of arrays along an existing axis.
a = np.array([[1,2,3], [4,5,6]]) b = np.array([7,8,9]).reshape(1, -1) print(np.concatenate((a, b))) # res: ''' [[1 2 3] [4 5 6] [7 8 9]] '''4 c_()
Translates slice objects to concatenation along the second axis.
a = np.array([[1,2,3], [4,5,6]]) b = np.array([7,8]) print(np.c_[a, b]) # res: ''' [[1 2 3 7] [4 5 6 8]] '''5 logical_and()
Compute the truth value of x1 AND x2 element-wise.
print(np.logical_and(True, False), np.logical_and(True, True)) # res: False True
还有其他逻辑函数也同理
持续更新



