摘要: from pandas import DataFrame,Series import pandas as pd import numpy as np # 使用numpy.random.permutation可实现对Series或DataFrame的列排列 df = DataFrame(np.aran 阅读全文
posted @ 2021-07-01 16:34 OTAKU_nicole 阅读(273) 评论(0) 推荐(0) 编辑
摘要: from pandas import DataFrame,Series import pandas as pd import numpy as np np.random.seed(12345) data = DataFrame(np.random.randn(1000,4)) # 找出某列中绝对值大 阅读全文
posted @ 2021-07-01 16:16 OTAKU_nicole 阅读(96) 评论(0) 推荐(0) 编辑
摘要: from pandas import DataFrame,Series import pandas as pd import numpy as np ages = [20, 22, 25, 27, 21, 23, 37, 31, 61, 45, 41, 32] bins = [18,25,35,60 阅读全文
posted @ 2021-07-01 16:00 OTAKU_nicole 阅读(52) 评论(0) 推荐(0) 编辑
摘要: Categorical.levels属性停止使用,现在为Categorical.categories 阅读全文
posted @ 2021-07-01 15:31 OTAKU_nicole 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Categorical.labels属性停止使用,现在为Categorical.codes 阅读全文
posted @ 2021-07-01 15:30 OTAKU_nicole 阅读(636) 评论(0) 推荐(0) 编辑
摘要: from pandas import DataFrame,Series import pandas as pd import numpy as np data = DataFrame(np.arange(12).reshape((3,4)), index=["Aa","Bb","Cc"], colu 阅读全文
posted @ 2021-07-01 15:17 OTAKU_nicole 阅读(56) 评论(0) 推荐(0) 编辑
摘要: from pandas import Series import numpy as np data = Series([1,-999,2,-999,-1000,3]) print(data) ''' 0 1 1 -999 2 2 3 -999 4 -1000 5 3 dtype: int64 ''' 阅读全文
posted @ 2021-07-01 15:03 OTAKU_nicole 阅读(79) 评论(0) 推荐(0) 编辑