show | version | enable_checker |
---|---|---|
step |
1.0 |
true |
- pip install gopup
import gopup as gp
df = gp.weibo_index(word="疫情", time_type="3month")
print(df.index)
print(df.values)
l = list(zip(df.index,df.values))
print(l[0][0])
print(l[0][1][0])
for data in l:
day = str(data[0]).replace(" 00:00:00","")
index = data[1][0]
print(day,",",index)
- 如果是两个关键字的指数呢?
import gopup as gp
df1 = gp.weibo_index(word="北京", time_type="3month")
df2 = gp.weibo_index(word="上海", time_type="3month")
print(df1.index)
l = list(zip(df1.index,df1.values,df2.values))
print(l[0][0])
print(l[0][1][0])
for data in l:
day = str(data[0]).replace(" 00:00:00","")
index1 = data[1][0]
index2 = data[2][0]
print(day,",",index1,",",index2)
- 这次我们通过gopup读取了weibo的数据
- 然后进行了输出
- 可以将输出重定向到一个csv文件
- 那这个东西可以如何展示呢?
- 我们下次再说!👋