如何获取 scipy.ndimage gaussian_filter 的值列表?
How to get the list of values of 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)
我想获取暗红色线的值列表。
问题已解决:
for i in range(0,len(result)):
print(result[i])
我在使用 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)
我想获取暗红色线的值列表。
问题已解决:
for i in range(0,len(result)):
print(result[i])