Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update_list = [['11259761' '24' '15.169291741233783']
- ['15293357' '82' '0.5716360249451222']
- ['18833226' '56' '7.073284312907512']
- ...
- ['75212792' '55' '0.31338063342346445']
- ['75213202' '62' '0.1843318978715103']
- ['8295513' '45' '3.9280856957929116']]
- con = pymysql.connect('connection settings here')
- with con:
- cursor = con.cursor()
- sql = ("INSERT INTO properties (id, closest_point, distance_from_closest_point) VALUES (%s, %s, %s)"
- "ON DUPLICATE KEY UPDATE closest_point=VALUES(closest_point), distance_from_closest_point=VALUES(distance_from_closest_point)")
- cursor.executemany(sql, update_list)
- con.commit()
- print("done")
- ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement