上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 67 下一页
摘要: ``` #导入pandas库 import pandas as pd #OneHotEncoder用来将数值型类别变量转换为0-1的标志性变量 #LabelEncoder用来将字符串型变量转换为数值型变量 from sklearn.preprocessing import OneHotEncoder,LabelEncoder #生成数据 df=pd.DataFrame({'id':[321313, 阅读全文
posted @ 2019-09-05 22:53 hank-li 阅读(1056) 评论(1) 推荐(0)
摘要: ``` #导入库 import pandas as pd import numpy as np from sklearn.preprocessing import Imputer #生成缺失数据 df=pd.DataFrame(np.random.randn(6,4),columns=['col1','col2','col3','col4']) df.iloc[1:2,1] = np.nan #增 阅读全文
posted @ 2019-09-05 08:37 hank-li 阅读(326) 评论(0) 推荐(0)
摘要: ``` import pandas as pd #生成数据 data1,data2,data3,data4=['a',3],['b',2],['a',3],['c',2] df=pd.DataFrame([data1,data2,data3,data4],columns=['col1','col2']) print(df) col1 col2 0 a 3 1 b ... 阅读全文
posted @ 2019-09-04 23:46 hank-li 阅读(4573) 评论(0) 推荐(1)
摘要: ``` import pandas as pd #生成异常数据 df=pd.DataFrame({'col1':[1,120,3,5,2,12,13], 'col2':[12,17,31,53,22,32,43]}) print(df) col1 col2 0 1 12 1 120 17 2 3 31 3 5 53 4 2 22 5 12 32 6 13 43 df_zscore=df.copy( 阅读全文
posted @ 2019-09-04 23:16 hank-li 阅读(3209) 评论(0) 推荐(0)
摘要: 参考网友解决的方法 任何报SSLError类的错,解决方法: 引入ssl模块 在url链接代码上方添加语句: 来源于 https://www.jianshu.com/p/b6b85e53d2e1 阅读全文
posted @ 2019-09-04 00:14 hank-li 阅读(1527) 评论(0) 推荐(0)
摘要: 猜测原因:Mac openssl 版本过低 阅读全文
posted @ 2019-08-31 20:51 hank-li 阅读(4472) 评论(0) 推荐(0)
摘要: 原因:openpyxl版本低,需升级 阅读全文
posted @ 2019-08-31 13:15 hank-li 阅读(6547) 评论(0) 推荐(0)
摘要: read_excel() 加载函数为read_excel(),其具体参数如下。 常用参数解析: io : string, path object ; excel 路径。 sheetname : string, int, mixed list of strings/ints, or None, def 阅读全文
posted @ 2019-08-28 21:58 hank-li 阅读(15797) 评论(0) 推荐(1)
摘要: 安装nest_asyncio 导入并调用 阅读全文
posted @ 2019-08-27 17:09 hank-li 阅读(5222) 评论(0) 推荐(0)
摘要: 从豆瓣图书Top250抓取数据,并通过词云图展示 导入库 抓取数据 提取词云图要展示的数据 绘图设置 结果展示 参考来源: 微信公众号:数据不吹牛(shujubuchuiniu) https://blog.csdn.net/weixin_40864434/article/details/903015 阅读全文
posted @ 2019-08-25 18:38 hank-li 阅读(1045) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 67 下一页