import requests import matplotlib.pyplot as plt def plot_weather(): # 中国气象局官方公开API,返回标准JSON数据,极其稳定 # 101190101 是南京的城市代码,可替换为其他城市 url = "h
import requests from bs4 import BeautifulSoup import pandas as pd headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.
""" 完整流程:读取英文 txt 文件 -> 清洗分词 -> 统计词频 -> 生成词云(字频越高字越大) """ import re from wordcloud import WordCloud import matplotlib.pyplot as plt from collections i