import pandas as pd
自带索引的一维数组 可以保存任何类型的数据
s.index
- RangeIndex(start=0, stop=5, step=1) 默认index是从0开始 步长为1的数组
type(s.index)
- <class 'pandas.core.indexes.range.RangeIndex'>
s = pd.Series(dic)
dic = {'a':1 ,'b':2 , 'c':3, '4':4, '5':5}
s = pd.Series(arr)
arr = [ 0.81, -2.39, 1.08, -0.49, 0.56 ]
s = pd.Series(arr, index = ['a','b','c','d','e'],dtype = object)
s = pd.Series(10, index = range(4))
s = pd.Series(arr, name = 'test')
s.rename ('test')
df.rename(index = **lambda** x: x+ 1)
s = pd.Series(arr)
arr = [ 0.81, -2.39, 1.08, -0.49, 0.56 ]
e = pd.Series(arr, index = ['a','b','c','d','e'])