简体   繁体   English

ValueError:在 sns.heatmap 上左边不能 >= 右边

[英]ValueError: left cannot be >= right on sns.heatmap

I have this value of m:我有这个 m 值:

array([[0.91992515, 0.978894  , 0.98183531, 0.99085009, 0.98576438,
        0.99062014, 0.9931621 , 0.99088091, 0.92711413, 0.78091824],
       [0.92729372, 0.97037023, 0.98044407, 0.97998279, 0.97441202,
        0.99145925, 0.98606282, 0.99012506, 0.94134074, 0.79332185],
       [0.92185014, 0.95902878, 0.97929859, 0.98272425, 0.98107767,
        0.98998082, 0.99233872, 0.9882673 , 0.92030007, 0.80480009],
       [0.91204637, 0.96461374, 0.97577399, 0.98063707, 0.96949238,
        0.99135023, 0.98836327, 0.98504972, 0.97783262, 0.77362221],
       [0.93386984, 0.97553176, 0.97664225, 0.98727471, 0.98023629,
        0.98472446, 0.98551005, 0.98410082, 0.9551242 , 0.77246934],
       [0.93045634, 0.97707605, 0.99085528, 0.98433924, 0.98237419,
        0.99572343, 0.99173379, 0.98824054, 0.96632308, 0.76564348],
       [0.93682766, 0.97289765, 0.98349541, 0.99275345, 0.98538131,
        0.99283469, 0.99232531, 0.98699528, 0.95912874, 0.91011888],
       [0.89040715, 0.96955484, 0.97332346, 0.96521449, 0.97545224,
        0.98275667, 0.98541254, 0.97983998, 0.90709436, 0.88003486],
       [0.95064926, 0.9512195 , 0.96981376, 0.9641239 , 0.98085016,
        0.95860326, 0.9453789 , 0.89857048, 0.94533682, 0.67875481],
       [0.66791672, 0.69540793, 0.7906791 , 0.74079674, 0.75139421,
        0.75080746, 0.68582624, 0.63543165, 0.59522635, 0.65718603]])

when I execute:当我执行:

sns_plot = sns.heatmap(m) sns_plot = sns.heatmap(m)

I get the following error:我收到以下错误:

ValueError: left cannot be >= right

What am I doing wrong?我究竟做错了什么?

Using np.array this worked perfectly for me使用 np.array 这对我来说非常有用

import numpy as np

m = np.array([[0.91992515, 0.978894  , 0.98183531, 0.99085009, 0.98576438,
        0.99062014, 0.9931621 , 0.99088091, 0.92711413, 0.78091824],
       [0.92729372, 0.97037023, 0.98044407, 0.97998279, 0.97441202,
        0.99145925, 0.98606282, 0.99012506, 0.94134074, 0.79332185],
       [0.92185014, 0.95902878, 0.97929859, 0.98272425, 0.98107767,
        0.98998082, 0.99233872, 0.9882673 , 0.92030007, 0.80480009],
       [0.91204637, 0.96461374, 0.97577399, 0.98063707, 0.96949238,
        0.99135023, 0.98836327, 0.98504972, 0.97783262, 0.77362221],
       [0.93386984, 0.97553176, 0.97664225, 0.98727471, 0.98023629,
        0.98472446, 0.98551005, 0.98410082, 0.9551242 , 0.77246934],
       [0.93045634, 0.97707605, 0.99085528, 0.98433924, 0.98237419,
        0.99572343, 0.99173379, 0.98824054, 0.96632308, 0.76564348],
       [0.93682766, 0.97289765, 0.98349541, 0.99275345, 0.98538131,
        0.99283469, 0.99232531, 0.98699528, 0.95912874, 0.91011888],
       [0.89040715, 0.96955484, 0.97332346, 0.96521449, 0.97545224,
        0.98275667, 0.98541254, 0.97983998, 0.90709436, 0.88003486],
       [0.95064926, 0.9512195 , 0.96981376, 0.9641239 , 0.98085016,
        0.95860326, 0.9453789 , 0.89857048, 0.94533682, 0.67875481],
       [0.66791672, 0.69540793, 0.7906791 , 0.74079674, 0.75139421,
        0.75080746, 0.68582624, 0.63543165, 0.59522635, 0.65718603]])



sns_plot = seaborn.heatmap(m)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM