上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 36 下一页
摘要: 在数据建模过程中,针对入模的数据需做数据清洗,特别针对缺失数据。 缺失数据比较多的情况下,可以考虑直接删除;缺失数据较少的情况下,可对数据进行填充。 此时,fillna() 则派上用场。语法为: fillna(self, value=None, method=None, axis=None, inp 阅读全文
posted @ 2021-09-05 22:37 Hider1214 阅读(3276) 评论(0) 推荐(0)
摘要: 一、字符串替换 replace() 方法用于替换字符串。语法为: string.replace(oldvalue, newvalue, count) oldvalue -- 待替换字符串 newvalue -- 替换字符串 count -- 指定次数 默认所有 # 普通用法 txt = "I lik 阅读全文
posted @ 2021-09-05 21:11 Hider1214 阅读(4035) 评论(0) 推荐(0)
摘要: 一、使用字典 dict 统计 循环遍历出一个可迭代对象的元素,如果字典中没有该元素,那么就让该元素作为字典的键,并将该键赋值为1,如果存在则将该元素对应的值加1。 lists = ['a','a','b',1,2,3,1] count_dist = dict() for i in lists: if 阅读全文
posted @ 2021-09-04 23:05 Hider1214 阅读(1492) 评论(0) 推荐(0)
摘要: 一、前沿技术 Dask包 数据量大、内存不足、复杂并行处理 计算图、并行、扩展分布式节点、利用GPU计算 类似 TensorFlow 对神经网络模型的处理 CUDF包 CUDF在GPU加速Pandas 缺点:GPU贵! 二、原始Apply import pandas as pd import num 阅读全文
posted @ 2021-08-31 15:26 Hider1214 阅读(1838) 评论(0) 推荐(0)
摘要: 在 Jupyter Notebook 编码中,有时需要查看 DataFrame 中的数据,可默认只显示10行数据,中间以“省略号”代替。 可在导入 pandas 模块时加入 pd.set_option 参数进行配置。 设置行 import pandas as pd pd.set_option('di 阅读全文
posted @ 2021-08-17 17:49 Hider1214 阅读(1730) 评论(0) 推荐(0)
摘要: 一、解释 变异系数(coefficient of variation)又称离散系数,是一个衡量数据离散程度的、没有量纲的统计量。 其值(CV)为标准差与平均值之比。 变异系数取值一般为:[0, +无穷) 二、实现 import numpy as np def coefficient_of_varia 阅读全文
posted @ 2021-08-05 18:04 Hider1214 阅读(2387) 评论(0) 推荐(0)
摘要: 想查看数据库现有所有表名,并清空临时表,可利用以下命令: -- 查看Sysbase IQ数据库所有表名 select name from sysobjects where type = 'U' and name like '%temp%' 最后将表名全部 drop 掉即可。 drop table a 阅读全文
posted @ 2021-07-29 16:44 Hider1214 阅读(1172) 评论(0) 推荐(0)
摘要: 之前跑完模型保存都是通过以下脚本保存。 # 保存模型 from sklearn.externals import joblib joblib.dump(model_lgb, r"E:\model.pkl") # 导出 # model_lgb = joblib.load(r"E:\model.pkl" 阅读全文
posted @ 2021-07-29 15:20 Hider1214 阅读(2756) 评论(0) 推荐(0)
摘要: 一、read_html函数 Pandas 包中的 read_html() 函数是最简单的爬虫,可以爬取静态网页表格数据。 但只适合于爬取 table 表格型数据,例如: ## 通过F12查看HTML结构 ## http://www.air-level.com/air/guangzhou/ <tabl 阅读全文
posted @ 2021-05-25 18:14 Hider1214 阅读(7940) 评论(0) 推荐(0)
摘要: 一、安装 emoji 库属于第三方库,在使用之前,需要提前进行安装和导入。 安装 pip install emoji # -- successfully pip install emoji -i https://pypi.tuna.tsinghua.edu.cn/simple/ 导入 import 阅读全文
posted @ 2021-05-23 19:41 Hider1214 阅读(1781) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 36 下一页