你是如此亲密.
>>> myarray[(myarray >= 2) & (myarray < 5)] = 100 >>> myarray array([[ 1, 100, 100, 100, 5], [ 1, 100, 100, 100, 5], [ 1, 100, 100, 100, 5]])