我试图沿着熊猫的2列并列。代码:
import pandas as pd
import numpy as np
from statsmodels import api as sm
import pandas_datareader.data as web
import datetime
start = datetime.datetime(2015,2,12)
end = datetime.datetime.today()
df = web.get_data_yahoo(['F', '^GSPC'], start, end)
df1 = df.concat(columns=[F['Close'], gspc['Close']], axis=1)
但是我遇到以下错误:
AttributeError: 'DataFrame' object has no attribute 'concat'
答案 0 :(得分:1)
它是pd.concat()
,而不是df.concat()
。