我有一个带有一些值的pandas数据框。我想用seaborn的条纹图来可视化数据的传播,尽管这是我第一次使用seaborn。我认为给异常值的数据点上色会很有趣,所以我为每个值创建了一个包含RGB元组的列。我以前用过这种方法,我发现它非常方便,所以我很想找到一种方法来实现这一点,因为seaborn很不错。在
以下是数据帧的外观:
SUBJECT CONDITION(num) hit hit_box_outliers \
0 4.0 1.0 0.807692 0
1 4.0 2.0 0.942308 0
2 4.0 3.0 1.000000 0
3 4.0 4.0 1.000000 0
4 5.0 1.0 0.865385 0
hit_colours
0 (0.38823529411764707, 0.38823529411764707, 0.3...
1 (0.38823529411764707, 0.38823529411764707, 0.3...
2 (0.38823529411764707, 0.38823529411764707, 0.3...
3 (0.38823529411764707, 0.38823529411764707, 0.3...
4 (0.38823529411764707, 0.38823529411764707, 0.3...
然后我试着把它画在这里:
^{pr2}$我得到了以下错误:
ValueError: Could not generate a palette for <map object at 0x000002265939FB00>
有什么办法让我完成这个看似简单的任务?在
似乎你想区分一个点是否是离群值。因此有两种可能的情况,由
hit_box_outliers
列确定。您可以将此列用作条带图的
hue
。要获得两个事件的自定义颜色,请使用调色板(或颜色列表)。在相关问题 更多 >
编程相关推荐