I am currently generating DateTimeIndex using a specific function, zipline.utils.tradingcalendar.get_trading_days . Time series are approximately daily, but with some spaces.
My goal is to get the latest date in DateTimeIndex for each month.
.to_period('M') and .to_timestamp('M') do not work, because they give the last day of the month, and not the last value of the variable for each month.
As an example, if this is my time series, I would like to select "2015-05-29", and the last day of the month is "2015-05-31".
['2015-05-18', '2015-05-19', '2015-05-20', '2015-05-21', "2015-05-22", "2015-05-26", " 2015-05-27 "," 2015-05-28 ", '2015-05-29', '2015-06-01']
source share