#add message

This commit is contained in:
xieshen 2021-05-19 09:28:18 +08:00
parent e1a1687af2
commit e2a1c78aee
1 changed files with 1 additions and 1 deletions

View File

@ -416,7 +416,7 @@ def upload_history_data(request):
month = table.row_values(row)[2] month = table.row_values(row)[2]
prcp = table.row_values(row)[3] prcp = table.row_values(row)[3]
temp = table.row_values(row)[4] temp = table.row_values(row)[4]
cur.execute('insert into prcp_m values (%s,%s,%s,%s,%s)' %(year,month,str(station),prcp,temp)) cur.execute('insert into prcp_m values (%s,%s,"%s",%s,%s)' %(year,month,station,prcp,temp))
# dataframe类型转换为IO缓冲区中的str类型 # dataframe类型转换为IO缓冲区中的str类型
# output = io.StringIO() # output = io.StringIO()
# data[['year', 'mon', 'station', 'prcp', 'temp']].to_csv(output, sep='\t', index=False, header=False) # data[['year', 'mon', 'station', 'prcp', 'temp']].to_csv(output, sep='\t', index=False, header=False)