我是 Python 新手,我的问题是如何从一些列表中构造一个矩阵?例如,如果我有列表:
[388.625, 174.125, 157.25, 166.375]
[432.25, 606.125, 326.25, 202.75]
[383.5, 718.25, 630., 284.]
[487.375, 299.125, 438.125, 432.5]
Run Code Online (Sandbox Code Playgroud)
我怎样才能加入他们来创建一个矩阵?
我正在做一个项目,我必须首先将图像标准化为 [0,1],然后在处理后对图像执行 dwt 和 idwt。所以首先我将图像转换为数组然后我用这个代码对其进行标准化
def normalization (array):
maxs = max([max(l) for l in array])
mins = min([min(l) for l in array])
range = max - mins
A = []
for x in array:
m = [(float(xi) - mins)/range for xi in x]
A.append(m)
return A
Run Code Online (Sandbox Code Playgroud)
代码运行良好,现在我不知道如何将其非规范化回实际范围。有人可以帮忙吗?