Loading

摘要: BeautifulSoup:Beautiful Soup 4.2.0 文档 — Beautiful Soup 4.2.0 documentation (crummy.com) Pandas:Pandas: 强大的 Python 数据分析支持库 | Pandas 中文 (pypandas.cn) re 阅读全文
posted @ 2021-08-16 15:05 橘崽崽啊 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 导入模块: from bs4 import BeautifulSoup 初始化: soup=BeautifulSoup(txt,"html.parser") 查找属性: title=soup.div['title'] 指定属性查找标签: sp1=soup.find('div',class_="lis 阅读全文
posted @ 2021-08-16 15:04 橘崽崽啊 阅读(71) 评论(0) 推荐(1) 编辑
摘要: 关于屏蔽FutureWarning: The default value of regex will change from True to False in a future version.的输出信息的方法: import warnings warnings.filterwarnings("ig 阅读全文
posted @ 2021-08-16 15:03 橘崽崽啊 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 关于Python123中的排序问题 统计方法 1、collections.Counter 2、dic={k:ls.count(k) for k in set(ls)} 3、dic[i]=dic.get(i,0)+1 排序方法: 1、sorted(dic.items(),key=lambda x:x[ 阅读全文
posted @ 2021-08-16 15:02 橘崽崽啊 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 修改列数据: df['price']=df['price'].str.replace('人均','') # 删除多余文字 df['price']=df['price'].str.split("¥").str[-1] # 分割文本串 df['price']=df['price'].str.replac 阅读全文
posted @ 2021-08-16 15:00 橘崽崽啊 阅读(89) 评论(0) 推荐(0) 编辑