会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
OTAKU_nicole
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
14
15
16
17
18
19
20
21
22
···
24
下一页
2021年2月20日
数据加载、存储于文件格式:读写文本格式的数据
摘要: import pandas as pd df1 = pd.read_csv("examples\ex1.csv") print(df1) ''' a b c d message 0 1 2 3 4 hello 1 5 6 7 8 world 2 9 10 11 12 foo ''' df2 = pd
阅读全文
posted @ 2021-02-20 11:07 OTAKU_nicole
阅读(56)
评论(0)
推荐(0)
2021年2月15日
pandas入门:整数索引
摘要: from pandas import Series, DataFrame import numpy as np ser = Series(np.arange(3)) print(ser) ''' 0 0 1 1 2 2 dtype: int64 ''' #print(ser[-1]) # 整数索引会
阅读全文
posted @ 2021-02-15 09:23 OTAKU_nicole
阅读(198)
评论(0)
推荐(0)
AttributeError: 'DataFrame' object has no attribute 'irow'
摘要: frame.irow(0)改为frame.iloc[0]
阅读全文
posted @ 2021-02-15 09:22 OTAKU_nicole
阅读(1154)
评论(0)
推荐(0)
AttributeError: 'Series' object has no attribute 'iget_value'
摘要: ser.iget_value(2)改为ser.iat[2]
阅读全文
posted @ 2021-02-15 09:16 OTAKU_nicole
阅读(125)
评论(0)
推荐(0)
pandas入门:层次化索引
摘要: from pandas import Series import numpy as np data = Series(np.random.randn(10), index=[['a','a','a','b','b','b','c','c','d','d'], [1,2,3,1,2,3,1,2,2,3
阅读全文
posted @ 2021-02-15 08:24 OTAKU_nicole
阅读(116)
评论(0)
推荐(0)
AttributeError: 'DataFrame' object has no attribute 'sortlevel'
摘要: frame.sortlevel(0)改为 frame.sort_index(0)
阅读全文
posted @ 2021-02-15 07:58 OTAKU_nicole
阅读(171)
评论(0)
推荐(0)
AttributeError: 'Series' object has no attribute 'ix'
摘要: data.ix[['b','d']] 报错AttributeError: 'Series' object has no attribute 'ix' 改为 data.loc[['b','d']]
阅读全文
posted @ 2021-02-15 05:47 OTAKU_nicole
阅读(49)
评论(0)
推荐(0)
2021年2月13日
pandas入门:处理缺失数据
摘要: # pandas使用浮点值NaN(Not a Number)表示浮点和非浮点数组中的缺失数据。 from pandas import Series,DataFrame import pandas as pd import numpy as np string_data = Series(['aard
阅读全文
posted @ 2021-02-13 22:49 OTAKU_nicole
阅读(126)
评论(0)
推荐(0)
AttributeError: 'DataFrame' object has no attribute 'ix'
摘要: df = DataFrame(np.random.randn(7,3)) df.ix[:5,1] = NA# 报错 AttributeError: 'DataFrame' object has no attribute 'ix'# 改为 df.iloc[:5,1] = NA
阅读全文
posted @ 2021-02-13 22:06 OTAKU_nicole
阅读(6510)
评论(0)
推荐(0)
pandas入门:汇总和计算描述统计-唯一值、值计数以及成员资格
摘要: from pandas import Series,DataFrame import pandas as pd obj = Series(['c','a','d','a','a','b','b','c','c']) print(obj.unique()) # 唯一值 ''' ['c' 'a' 'd'
阅读全文
posted @ 2021-02-13 21:12 OTAKU_nicole
阅读(379)
评论(0)
推荐(0)
上一页
1
···
14
15
16
17
18
19
20
21
22
···
24
下一页
公告