第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

涉及動(dòng)態(tài)數(shù)據(jù)幀對(duì)象的嵌套 Pandas iterrows

涉及動(dòng)態(tài)數(shù)據(jù)幀對(duì)象的嵌套 Pandas iterrows

手掌心 2021-11-09 20:29:06
我的腳本接收 F500 公司的“實(shí)時(shí)”在線列表,遍歷每個(gè)股票代碼,獲取指定時(shí)間段內(nèi)的股票代碼表現(xiàn)。我無法弄清楚的是如何將模式/存儲(chǔ)到 2D 列表中,每個(gè)符號(hào)的多行代碼數(shù)據(jù)。不知何故,第二個(gè) iterrows 將不起作用。提前致謝:import pandas as pd #dataframe extends from pdimport pandas_datareader.data as web #grabs stock dataimport datetime as dt #to specify date range for grab#VARS:#url to f500 listdata_url = "https://query.data.world/s/vjghzuarkh6dap3dblkxanppyh5jtl" source = "yahoo" start = dt.datetime(2019, 2, 13) #datetime typeend = dt.datetime.now()    results = []#read into memorydf500 = pd.read_csv(data_url)for index, row in df500.tail().iterrows():     try:        dfdr = web.DataReader(row['SYMBOL'], source, start, end) #returns a dataframe presumably        for index2, row2 in dfdr().iterrows():             # here i want to append to the results list: row['SYMBOL'], row2['Date'], row2['High']            print ("test output ", row2[0]) #not even this works    except Exception as e:         pass# commit to sqlite3 from list or df
查看完整描述

1 回答

?
森欄

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超5個(gè)贊

這里dfdr后面的括號(hào)是錯(cuò)誤的:

dfdr().iterrows()

應(yīng)該:

dfdr.iterrows()


查看完整回答
反對(duì) 回復(fù) 2021-11-09
  • 1 回答
  • 0 關(guān)注
  • 202 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)