I am trying to store data frame into mysql after converting it to dictionary
# a_two.fillna(0)
for data in a_two:
fav_two = BankData(process_date=data.get('Process date'), description=data.get(
'Description'), debit=data.get('Debit'), credit=data.get('Credit'), balance=data.get('Balance'), category=data.get('Categories'))
db.session.add(fav_two)
db.session.commit()
print("Bank data submitted")
return render_template("index.html")
Timestampas an argument to your query, see github.com/PyMySQL/PyMySQL/issues/499 and stackoverflow.com/questions/46205532/…. The solution is to convert the arguments before passing them to the query, or in this case the ORM object. "Process date" sounds like a good candidate to check.pandas.Timestamp, consider usingto_pydatetimebefore passing it as an argument toBankData. Some other questions that seem related: stackoverflow.com/questions/43108164/…, stackoverflow.com/questions/46034756/….127.0.0.1 - - [10/Mar/2020 19:55:30] "POST /upload_two HTTP/1.1" 200 - datetime64[ns]