随笔分类 -  python

centOS 使用lxml.etree 模块报错 ImportError: cannot import name etree
摘要:最近用python的lxml库解析了个html文件,在windows python3.8下面运行没什么问题,但是在centOS python2.7环境下一直报错 ImportError: cannot import name etree 网上有人说lxml版本不一样,有的没带etree模块,所以我准 阅读全文
posted @ 2021-08-31 14:28 特工泰瑞 阅读(977) 评论(0) 推荐(0)
python pandas DataFrame 清除非数字类型、重新索引
摘要:将DataFrame格式的数据中不是数字类型的去掉并重新索引: 首先将所有的值都转成整数字类型 df['io']=pd.to_numeric(df['io'],'coerce') df['res']=pd.to_numeric(df['res'],'coerce') coerce是将不能转为数字类型 阅读全文
posted @ 2021-08-27 17:58 特工泰瑞 阅读(1568) 评论(0) 推荐(0)