Pandas是这么强大的东西,不能一直看,看有印象,写才有手感。保持手感。---Python逐梦者。
1,使用列表创建Series:
1 import pandas as pd 2 3 alist = [1.5, 2.5, 3, 4.5, 5.0, 6] 4 data = pd.Series(alist) 5 print(data)
2,使用name创建Series:
1 import pandas as pd 2 3 alist = ['China', 'USA', 'India'] 4 data = pd.Series(alist, name='Countries') 5 print(data)