摘要: # 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 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(6497) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(372) 评论(0) 推荐(0) 编辑
摘要: from pandas import DataFrame from pandas_datareader import data as web all_data = {} for ticker in ['AAPL','IBM','MSFT','GOOG']: all_data[ticker] = we 阅读全文
posted @ 2021-02-13 13:06 OTAKU_nicole 阅读(344) 评论(0) 推荐(0) 编辑
摘要: import pandas.io.data as web报错ModuleNotFoundError: No module named 'pandas.io.data'安装pandas_datareader后改为 from pandas_datareader import data as web 阅读全文
posted @ 2021-02-13 12:28 OTAKU_nicole 阅读(1118) 评论(0) 推荐(0) 编辑