0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pandas series その1

0
Last updated at Posted at 2020-02-29

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
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?