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)