Hello everyone,
I am trying to save data in local database.
-
I am trying to store data directly :
curs = connection.cursor()
result = cHandler.fetchall()
for row in result:
rt= row
print (rt)
curs.execute(“INSERT INTO table (UserId, C1) VALUES (%s, %s)”, row) -
Also trying to import data from csv file :
c = csv.writer(open(‘file.csv’, ‘wb’))
for x in result:
c.writerow(x)
csv_data = pd.read_csv(‘file.csv’,header=None,delim_whitespace=True)
for row in csv_data:
print csv_data
curs.execute(“INSERT INTO testo (UserId, C1) VALUES (%s, %s)”, row)
Getting this error(ValueError: No columns to parse from file)
Thanks in advance.