Numpy Cannot cast ufunc multiply output from dtype

后端 未结 3 1635
無奈伤痛
無奈伤痛 2021-01-01 14:45

I\'d like to multiply an int16 array but a float array, with auto rounding, but this fails :

import numpy

A = numpy.array([1, 2, 3         


        
3条回答
  •  温柔的废话
    2021-01-01 15:43

    import numpy as np
    
    A = np.float_(A)
    A *= B
    

    try this. I think are different array type you get fail.

    Cast

提交回复
热议问题