Mar-26-2019, 05:02 AM
For 1D I can use:
Exception: Data must be 1-dimensional
The code which I used is:
What else I tried:
I also tried the old function rolling_mean i.e. pd.rolling_mean(a,4,center=True), but it is also not working, it gives error:
AssertionError: cannot support ndim > 2 for ndarray compat
a=np.array([1,2,3,4]) b=pandas.Series(a).rolling(window=3,center=True).mean()But the problem is, if I have array a, in 3D then using this method gives error
Exception: Data must be 1-dimensional
The code which I used is:
t[:,:,0]=(pd.Series(imgg[:,:,0:4]).rolling(window=[1,1,3],center=True).mean())Here imgg is 3D numpy array.
What else I tried:
I also tried the old function rolling_mean i.e. pd.rolling_mean(a,4,center=True), but it is also not working, it gives error:
AssertionError: cannot support ndim > 2 for ndarray compat