#导入Flask框架模块及其他模块,代码略
app =Flask _name_ )
@app.route("/input")
def add_data():
id =int(request.args.get(id'))
value =float(request args.get(val'))
nowtime =datetime.datetime.now()
nowtime =nowtime.strftime('%Y-%m-%d %H:%M:%S')
db=sqlite3.connect("data.db")
cur=db.cursor()
cur.execute("INSERT INTO sensorlog(id,sensorvalue,updatetime)VALUES(%d,%f,'%s)" %(id,value,nowtime))
db.commit()
cur.close()
db.close()
#服务器其他功能,代码略
if _name_ =="_main_ ":
app.run(host="6.56.102.4",port=8080)
请回答下列问题
#导入数据处理相关模块,代码略
df=df[ ]
dfinsert( 0,"月份","")#插入列
for i in df index:
data=str(dfat[i,"采集时间"])
dfat[i,”月份"]=data[5:7]
gf=dfgroupby(" 月份",as_index=True).数值.mean()
plt.plot( , gf.values)
#设置绘图参数,代码略