- 博客(6)
- 收藏
- 关注
原创 Pandas_Profiling报错
在使用Pandas_Profiling.ProfilingReport报错," concat() got an unexpected keyword argument ‘join_axes’ "经查是pandas和Pandas_Profiling版本过低导致,在命令行更新 pip install --upgrade pandaspip install --upgrade pandas_Profiling...
2020-05-23 02:28:37 2521 1
原创 python列表内容排序
需求,有一个数字列表,我们需要按照大小排序:a = [103,22,456,100,482,321]排序的结果是:[22, 100, 103, 321, 456, 482]#排序#a = [103,22,456,100,482,321]count = 1while count < len(a): for i in range(0,len(a)-1): temp1 = a[i] temp2 = a[i+1] if a[i]
2020-05-19 16:16:35 286
原创 Python将字符串转变为变量名
需求是有一个列表 lst = ["A", "B", "C“],需要将得到三个以 A B C为变量名的列表,即A = ["A"] ,B=["B"],C=["C"]。解决方法lst = [“A”, “B”, "C“]for i in lst:globals()[i] = [i]print(A,B,C)结果为[‘A’] [‘B’] [‘C’]具体参考:https://www.jia...
2020-02-17 23:52:20 4132 3
原创 python函数return使用
1、函数体中包含returndef yue(): print("你") print("我") print("他") return "美⼥女女⼀一枚"girl = yue()print(girl) print(type(girl))此时变量girl可以接到一个返回值,类型为字符串,结果为:你我他美⼥女女⼀一枚<class ‘str’>...
2020-02-13 00:36:15 291
原创 python列表取最大值,最大值的位置
lst = [1,2,3]a = max(lst) #最大值b = lst.index(max(lst)) #最大值的位置print(“列表的最大值:{}”.format(a),“位置:{}”.format(b))结果: 列表的最大值:3 位置:2
2020-02-12 02:48:17 30934 3
原创 利用python进行数据分析Python报错IOError: [Errno 22] invalid mode ('r') or filename
使用pylab导入一个dat的数据时候,老是报错,[Errno 22] invalid mode (‘r’) or filename: ‘C:\Users\lc\Desktop\movielens\ratings.dat’查询后发现是路径的问题,具体来说应该是 \r 最简单的方法就是改文件的名字,ratings = pd.read_table(‘C:\Users\lc\Deskto...
2019-03-04 23:07:18 637
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人