python numpy较大值 较小值

目录

较大值:

较小值:


较大值:


if __name__ == '__main__':
    import numpy as np

    array1 = np.array([2, 5, 9, 12])
    array2 = np.array([3, 7, 6, 10])

    result = np.maximum(array1, array2)
    print(result)

较小值:


if __name__ == '__main__':
    import numpy as np

    array1 = np.array([2, 5, 9, 12])
    array2 = np.array([3, 7, 6, 10])

    result = np.minimum(array1, array2)
    print(result)

你可能感兴趣的:(python基础,python,numpy,开发语言)