Py学习  »  Python

python normalise在列表列表中浮动,在每个子列表中范围从0.0(最小)到1.0(最大)

Electric_Sheep01 • 5 年前 • 1668 次点击  

正在尝试规范化列表列表,我的列表如下:

[[7.460143566, 9.373718262, 9.540244102, 9.843519211, 9.034710884, 10.71182728], [0.490880072, 0.637698293, 0.806753874, 0.906699121, 0.697924912, 0.949957848], [52.33952713, 69.05165863, 65.69918823, 67.53870392, 65.12568665, 72.78334045]]

进入以下:

[[0.0, 0.3435355, 0.565656, 0.6576767, 1.0], [0.0, 0.232424, 0.465664, 0.76768, 1.0], [0.0, 0.24534535, 0.4564545, 0.576576, 1.0]]

我在尝试

normalized = (col_list_filter-min(col_list_filter))/(max(col_list_filter)-min(col_list_filter))
    print(normalized)

但是继续获取typeerror不支持的操作数类型-:“list”和“list”

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/41199
 
1668 次点击  
文章 [ 4 ]  |  最新文章 5 年前