保捱科技网
您的当前位置:首页pandas.Series函数用法

pandas.Series函数用法

来源:保捱科技网
pandas.Series函数⽤法

class pandas.Series(data=None, index=None, dtype=None, name=None, copy=False, fastpath=False)

e.g.,

s = pd.Series(data = np.random.randn(5), index=['a', 'b', 'c', 'd', 'e']))

会⽣成:

a 0.2941b 0.2869c 1.7098d -0.2126e 0.2696dtype: float

也可以直接写:

s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'])

加上dtype的话:

s = pd.Series(data = np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'],dtype = np.float16)

因篇幅问题不能全部显示,请点此查看更多更全内容