<jupyter_start><jupyter_text>DataFrame or Series 를 수직 또는 수평으로 연결<jupyter_code>import FinanceDataReader as fdr
samsung_df = fdr.DataReader('005390', '2009-01-01', '2017-12-31')
kodex_df = fdr.DataReader('069500', '2016-01-01', '2017-12-31')
samsung_df.head(2)
kodex_df.head(2)
#default axis 0, 수직으로
pd.concat(
    [samsung_df, kodex_df]
).head(2)<jupyter_output><empty_output><jupyter_text>- Column, index alignment 특징은 그대로 적용됨!<jupyter_code>pd.concat([samsung_df, kodex_df[['Open', 'High']]]).tail()
 pd.concat(
     [samsung_df, kodex_df],
     keys=['삼성', 'KODEX200'],
     names=['종목명', '날짜']
 )
 pd.concat(
     [samsung_df, kodex_df],
     axis=1
 ).head()
 pd.concat(
     [samsung_df, kodex_df],
     keys=['삼성', 'KODEX200'],
     axis=1
 )
 pd.concat(
     [samsung_df, kodex_df],
     axis=1,
     names=['종목명'],
     join='inner',
 ).head()
pd.concat([samsung_df.head(), kodex_df['Close'].head()], join='inner')
samsung_diff_col_df = samsung_df.copy()
samsung_diff_col_df.columns = ['1_' + col for col in samsung_df.columns]
samsung_diff_col_df.head()
samsung_df.head()
pd.concat([samsung_df, samsung_diff_col_df])<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup