python - How to update the whole of the column of MySql table with one numpy array (without considering iteration) -
is there clever way update 1 (of many) column of 1 mysql table values of numpy array?
i tried code did not work:
update mytable set thiscol =onenumpyarray
i can of course iterate on array , update column values 1 one following code, don't think elegant , faster way:
for r in range(0,mynumpy.size): sqlstr="update mytable set thiscol=" + str(mynumpy[r])+" id = "+id (...and run consecutive sql statements)
but aim update entire column numpy array no reference clause , without iteration.
there should way export numpy arrays (not insert, update) mysql table column without iteration.
i walked through numpy documentation did not see handy.
thanks in advance interest guys.
Comments
Post a Comment