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 3 years have passed since last update.

Pandasの基礎 DataFrameの生成

Last updated at Posted at 2021-07-13
1 / 2

DataFrameとはPandasで扱う種類のデータ構造。
引数にSeriesを渡すと生成できる。

pd.DataFrame([Series1, Series2, .....])

また、バリューにリスト方を持った辞書型を用いても生成可能。
注意点としては、リスト型の長さは同じでないといけない。

data = {"fruits": ["apple", "orange", "banana"], 
          "year": [2018, 2019, 2020], 
          "season": [11, 2, all]}
df = pd.DataFrame(data)
display(df)

#出力結果

スクリーンショット 2021-07-13 21.40.04.png

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?