pythonnumpysmoothingscipy.ndimage

How to get the list of values of scipy.ndimage gaussian_filter?


I'm trying to get a list of values when I use a gaussian_filter.

I read a file with a column and float values. Example:

0.8457
0.0
0.505
etc...

My script is this:

#!/usr/bin/env python
import numpy as np      
from scipy.ndimage.filters import gaussian_filter1d

with open("file.txt") as f:
     m1 = map(float,f)

wt=np.array(m1).astype(np.float64)
wtsmoothed = gaussian_filter1d(wt, sigma=500)
result=np.count_nonzero(wtsmoothed)
print (result)

enter image description here

I want to get the list of values of the line dark red.


Solution

  • the problem is solved with:

    for i in range(0,len(result)):
        print(result[i])