首页 > 解决方案 > 如何在熊猫中获取相应股票的价格

问题描述

如何根据图像获得股票代码的相应价格。这是我到达的地方,我不知道如何走得更远:

def get_holdings():
df = pd.read_csv('Holdings.csv')
# Can I write a function to obtain the current price and put this into the dataframe
for tick in df.Ticker:
    df['Price'] = yf.download(tick, period='1d', progress=False)['Adj Close']
return df

在此处输入图像描述

标签: pythonpandas

解决方案


推荐阅读