如何获取scipy.ndimage gaussian_filter的值列表?

问题描述

我尝试使用gaussian_filter获取值列表。

我读取了一个具有列和浮点值的文件。示例:

0.8457
0.0
0.505
etc...

我的脚本是这样的:

#!/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

我要获取深红色线的值列表。

解决方法

问题的解决方法是:

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