plot - Seaborn tsplot windowed estimators -


i want tsplot estimator windowed function rolling mean rather mean. ideally i'd pass rolling mean function estimator parameter of tsplot(), individual timepoints passed estimator. so, looks i'm stuck pre-processing data.

is correct? there approach i'm overlooking here?

i don't think quite understand you're trying do, bootstrap function used in tsplot compute confidence interval gets whole array , axis=0, , resamples rows of array before reducing on operations. seems work:

import numpy np import pandas pd import seaborn sns import matplotlib.pyplot plt  data = np.cumsum(np.random.randn(25, 40), axis=1) sns.tsplot(data=data) 

enter image description here

def rolling_mean(data, axis=0):     return pd.rolling_mean(data, 4, axis=1).mean(axis=axis)  sns.tsplot(data=data, estimator=rolling_mean) 

enter image description here


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -