摘要:
from pandas import DataFrame,Series import pandas as pd import numpy as np # 使用numpy.random.permutation可实现对Series或DataFrame的列排列 df = DataFrame(np.aran 阅读全文
摘要:
from pandas import DataFrame,Series import pandas as pd import numpy as np np.random.seed(12345) data = DataFrame(np.random.randn(1000,4)) # 找出某列中绝对值大 阅读全文
摘要:
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 阅读全文
摘要:
Categorical.levels属性停止使用,现在为Categorical.categories 阅读全文
摘要:
Categorical.labels属性停止使用,现在为Categorical.codes 阅读全文
摘要:
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 阅读全文
摘要:
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 ''' 阅读全文