简体   繁体   English

拉出一个月的最后一个工作日的股票价值

[英]Pull stock value of last business day of a month

Need help in Pulling stock value of last business day of a month in a time series/dataframe I am executing the fol code: 我在执行以下代码时需要帮助,以获取一个时间序列/数据帧中一个月的最后一个工作日的库存值:

import pandas as pd
import datetime
import matplotlib
import warnings
warnings.filterwarnings('ignore')
start = datetime.datetime(2014, 3, 31)
end = datetime.datetime(2017, 9, 30)
stocks = ['AAPL', 'GOOG']
col = 'Adj Close'
df = web.get_data_yahoo(stocks,start,end)
data = df.ix[col]    
dataframe = pd.DataFrame(data)

This gives me a dataframe with all the close values. 这给了我一个具有所有接近值的数据框。 I want to get the values only from the last business day of the month 我只想从当月的最后一个工作日获取值

请忽略该问题,我已经设法找到了答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM