首页 > 解决方案 > 使用 seaborn 绘图会导致 python 内核崩溃

问题描述

我在 Win10 上使用 Anaconda,当我尝试在包含 seaborn 的本地主机上执行简单单元时,我在 5 秒内收到死内核消息,重新启动后它只是无限执行 sns 绘图单元。例如在 Titanic 数据集中

使用 Collab 或 Binder没有这样的问题 collab 没有问题使用 Binder 没问题,在线 Jupyter Notebook

似乎我遗漏了一些明显的东西。代码:

import seaborn as sns       
import pandas        
import matplotlib.pyplot as plt       
df = sns.load_dataset('titanic')       
df.head()           
sns.countplot(x='sex',data=df) 

      

标签: pythonwindowsmatplotlibseabornjupyter

解决方案


推荐阅读