1 | import numpy |
1 | array([False, True, False, False, False]) |
1 | matrix = numpy.array([[12,3,67,9],[34,2,7,9],[3,8,9,6]])matrix == 3 |
1 | array([[False, True, False, False], |
1 | vector = numpy.array([3,6,7,89,90]) |
1 | [False True False False False] |
1 | matrix = numpy.array([[12,3,67,9],[34,2,7,9],[3,8,9,6]]) |
1 | [ True False False] |
1 | #逻辑运算 |
1 | [False False False False False] |
1 | vector = numpy.array([3,6,7,89,90]) |
1 | [ True True False False False] |
1 | #类型转换vector = numpy.array(['3','6','7','89','90'])print(vector.dtype)vector = vector.astype(float)print(vector.dtype)print(vector) |
1 | <U2 |
1 | #最小值 |
1 | #最大值 |
1 | #列求和 |
1 | [49 13 83 24] |
1 | #行求和 |
1 | [91 52 26] |