Python 如何从下面的代码中获取一个数据帧

Python 如何从下面的代码中获取一个数据帧,python,pandas,dataframe,quandl,Python,Pandas,Dataframe,Quandl,试图从不同的时间序列,从quandl,一个单一的数据帧 尝试使用for循环从不同的quandl时间序列获取数据。 到目前为止: Open High Low Close Date 2019-04-05 145.0 145.0 138.0 140.2 Open High Low Close Date 2019-04-05 41.29 41.59 41.03 41.05 Open

试图从不同的时间序列,从quandl,一个单一的数据帧

尝试使用for循环从不同的quandl时间序列获取数据。 到目前为止:

             Open   High    Low  Close
Date
2019-04-05  145.0  145.0  138.0  140.2
             Open   High    Low  Close
Date
2019-04-05  41.29  41.59  41.03  41.05
             Open   High   Low  Close
Date
2019-04-05  12.04  12.08  11.9   11.9
预期结果是在for循环之后有一个数据帧,如下所示:

                 Open   High    Low  Close
     |  ticker1|
date |  ticker2|
     |  ticker3|


在循环中,将每个
数据帧
附加到
列表
,通过参数
连接在一起,然后:

                 Open   High    Low  Close
     |  ticker1|
date |  ticker2|
     |  ticker3|

tickers=['WSE/AMICA','WSE/PZU','WSE/WIELTON']

notowania=[]

for ticker in tickers:
    raw_notowania=quandl.get(ticker,authtoken="mytoken",rows=1)[['Open','High','Low','Close']]
    notowania.append(raw_notowania)

df = pd.concat(notowania, keys=tickers).swaplevel().sort_index(level=0)
print (df)
                          Open    High     Low   Close
2019-04-05 WSE/AMICA    145.00  145.00  138.00  140.20
           WSE/PZU       41.29   41.59   41.03   41.05
           WSE/WIELTON   12.04   12.08   11.90   11.90