📅  最后修改于: 2022-03-11 14:47:08.648000             🧑  作者: Mango
myNumpyArray = np.random.rand((3,3))
#convert to list, then to string, then store as VARCHAR(20000) in mysql
numpyString = str(myNumpyArray.tolist())
query = "insert into mytable(mycolumn) VAlUES ('"+numpyString+"')"
cursor.execute(query)
#Note: to retreive from mysql,you can convert to array using eval:
#myArray = eval(mycolumn)