Seriesは一次元のデータ構造体である。
1
import pandas as pd
series = pd.Series([3, 6, 9])
print(series)
1の実行結果
0 3
1 6
2 9
dtype: int64
左端の列にindexがある。
indexをかえる場合は下記の様に書く
2
import pandas as pd
names = ["田中", "山田", "高橋"]
series1 = pd.Series(names)
series2 = pd.Series(names, index=['a', 'b', 'c'])
print(series1)
print(series2)
2の実行結果
0 田中
1 山田
2 高橋
dtype: object
a 田中
b 山田
c 高橋
dtype: object