0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Python】pandasのconcat関数の結合に関して

Posted at

pd.concatは、Pandasライブラリでデータフレームやシリーズを結合するための関数です。主に、縦または横にデータを結合するのに使います。

基本的な使い方
import pandas as pd

例のデータフレーム
df1 = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
df2 = pd.DataFrame({'A': [5, 6], 'B': [7, 8]})

縦に結合
result = pd.concat([df1, df2], axis=0)

横に結合
result_horizontal = pd.concat([df1, df2], axis=1)
axis=0:縦に結合(行を追加)
axis=1:横に結合(列を追加)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?