In fact, I think you should not change the data itself, but to view the data in the right interval to build. This view would be the actual data points to be built.
A naive approach would be, for example, for a computer screen to calculate how many points are in your interval and how many pixels you have. Thus, to build a frame with 10,000 points in a window width of 1,000 pixels, you take a fragment with STEP 10 using this syntax (integer_date will be a 1D array for example only):
data_to_plot = whole_data[::10]
This can have undesirable effects, in particular masking short peaks that can βrun invisibleβ from the cutting operation. An alternative would be to split your data into bins and then calculate one datapoint (maximum value, for example) for each bin. I believe that these operations can be fast due to operations with the numpy / pandas array.
Hope this helps!
source share