<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>
{'fraction_non_alphanumeric': 0.17850953206239167, 'fraction_numerical': 0.05025996533795494, 'mean_word_length': 5.111111111111111, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '566981', 'license': 'MIT', 'n_tokens_mistral': 573, 'n_tokens_neox': 569, 'n_words': 78, 'path': '1111_03_concat.ipynb', 'repo_name': 'wlstjdpark/python-pandas-quant-investment-study', 'size': '1154'}