'numpy.float64' object has no attribute 'translate' Inserting value to Mysql in Python

前端 未结 4 771
庸人自扰
庸人自扰 2021-02-14 15:00
import dataset
db = dataset.connect(....)
table = db[...]

When I try to insert some value into Mysql table, this error occurred.

Sample Value

4条回答
  •  情话喂你
    2021-02-14 15:14

    You can solve this problem by just adding a float method for every np.float variable like below:

    variable = float(variable)
    

提交回复
热议问题