1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import pandas as pd index = ["a", "b", "c", "d", "e"] data = [10, 5, 8, 12, 3] # indexとdataを含むSeriesを作成しseriesに代入 series = pd.Series(data, index=index) # インデックスがstrawberryの要素を削除してseriesに代入 series = series.drop("c") print(series) 結果 a 10 b 5 d 12 e 3 dtype: int64 |
コメントを残す