结合下方代码,在 URL 划线处应填写合适的答案。
#导人 Flask 框架模块及其他相关模块,代码略
app = Flask(_name_)
@app.route('/upload')
def view():
wd=float( request.args.get('val')) #服务器获取提交的温度值
# 服务器其他功能代码略
if _name_ == '_main_'
app.run(host="192.168.10.102",port=5000) #设置服务器 IP 和端口
图a
import pandas as pd
df = pd.read_excel("ddsl.xlsx") #读文件中的数据
df= df.drop(["日期","订单号","单价","金额"],axis=1) #删除列
dfg = df.groupby(" ① ",as_index= False).sum() #分组求和
dfs = ②
plt.bar(dfs["菜品"], dfs["份数"]) #绘制柱形图
#设置图表样式,显示图表代码略
图b
①
请回答下列问题:
图 a
序号 | 路由 | 功能 |
1 | / | 访问系统首页 |
2 | /readhreadt | 查看历史温湿度数据 |
3 | / | 查看实时温湿度数据 |
图 b | 图 c |
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_excel("data.xlsx") #读取文件 data.xlsx 中的数据
for i in range(len(df)) :
if i%2==0 and df.at[i,"监测值"]>30:
df.at[i,"状态"]=1
if i%2==1 and df.at[i,"监测值"]<50:
df.at[i,"状态"]=1
dfg=df.groupby("时间" , as_index=False).状态.sum()
time=[] ; data=[]
for t in range (24):
s=str(t); c=0
if t<10:
s='0'+s
time.append(s)
dft= dfg[]
for j in dft.index:
if dft.at[j,"时间"][:2]==s:
data.append(c)
plt.plot(time, data)
#设置绘图参数,显示如图 c 所示线形图,代码略
m = int(input("请输入内存容量:"))
s = input("请输入英语句子:")
dic = {}
head = tail = 0
word = ""
for ch in s:
if ch == " " or ch == "," or ch == ".":
if word not in dic or dic[word] < head:
if tail - head == m:
dic[word] = tail
tail + = 1
word = ""
else:
if :
ch = chr(ord(ch) + 32)
word += ch
print("需要去外存查找",,"次词典")