Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Resampling giving different results every time you run it

I used the following function to resample data:

hist = data.history(context.aapl, 'price', 10, '1m').resample('2T').last()

The problem is that I sometimes get 5 results and sometimes 6. This is completely random, I do not change anything in the code. How can this be the case and how can you solve that? I tried to look this up in the appropriate documentation but I still couldn't figure it out.