根据您提供的文档,
ufunc.reduce将其
op.identity用作初始值。
numpy.bitwise_and.identity是
1,不是,
0xffffffff....也不是
-1。
>>> np.bitwise_and.identity1
因此
numpy.bitwise_and.reduce([0x211f,0x1013,0x1111])等于:
>>> np.bitwise_and(np.bitwise_and(np.bitwise_and(1, 0x211f), 0x1013), 0x1111)1>>> 1 & 0x211f & 0x1013 & 0x11111
>>> -1 & 0x211f & 0x1013 & 0x111117
似乎没有办法根据文档指定初始值。(与Python内置函数不同
reduce)



