Python np.arange()使用报错

import numpy as np
>>TT=1
>>NT=50
>>TT/2**((NT-np.arange(1,NT+1)))
>>np.arange(1,NT+1)


>>2**(NT-np.arange(1,NT+1))
__main__:4: RuntimeWarning: divide by zero encountered in true_divide
Out[55]: 

array([          0,           0,           0,           0,           0,
                 0,           0,           0,           0,           0,
                 0,           0,           0,           0,           0,
                 0,           0,           0, -2147483648,  1073741824,
         536870912,   268435456,   134217728,    67108864,    33554432,
          16777216,     8388608,     4194304,     2097152,     1048576,
            524288,      262144,      131072,       65536,       32768,
             16384,        8192,        4096,        2048,        1024,
               512,         256,         128,          64,          32,
                16,           8,           4,           2,           1],
      dtype=int32)

你可能感兴趣的:(Python语言专栏,python,arange)