weighted-average

Is there a way to get Pandas ewm to function on fixed windows?

Is there a way to get Pandas ewm to function on fixed windows? Question: I am trying to use Pandas ewm function to calculating exponentially weighted moving averages. However i’ve noticed that information seems to carry through your entire time series. What this means is that every data point’s MA is dependant on a different …

Total answers: 3

Python – Time-weighted average Pandas, grouped by time interval

Python – Time-weighted average Pandas, grouped by time interval Question: I have a time-series in a Pandas DataFrame. The timestamps can be uneven (one every 1-5 minutes), but there will always be one every 5 minutes (timestamps with minutes ending in 0,5,10,15,20,25,30,35,40,45,50,55). Example: 2017-01-01 2:05:00 32.90 2017-01-01 2:07:30 29.83 2017-01-01 2:10:00 45.76 2017-01-01 2:15:00 16.22 …

Total answers: 5

Create a weighted mean for a irregular timeseries in pandas

Create a weighted mean for a irregular timeseries in pandas Question: from simulation data with variable timestep I have a irregular time-vector as index for my values, they are stored in a pandas.DataFrame. Let’s consider a simplified test case: import pandas as pd import datetime time_vec = [datetime.time(0,0),datetime.time(0,0),datetime.time(0,5),datetime.time(0,7),datetime.time(0,10)] df = pd.DataFrame([1,2,4,3,6],index = time_vec) Using the …

Total answers: 1