我的 pandas 和 seaborn 命令没有响应

my pandas and seaborn comands not responding

导入 pandas 作为 pd

dataFrame = pd.read_excel("C:/Users/****/desktop/python folder/tensorflow/sheet.xlsx")

将 seaborn 导入为 sbn 将 matplotlib.pyplot 导入为 plt

sbn.pairplot(数据帧)

输出为:PSC:\Users\-----\Desktop\python文件夹> & C:/Users/------/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/-----/Desktop/pythonfolder/tensorflow/tensorflow-101.py

对于你的问题,试试这个。

import seaborn as sbn 
import matplotlib.pyplot as plt

sbn.pairplot(dataFrame)
plt.show()

图表将出现在新的 window,我猜。这就是为什么您的代码在 jupyter 中运行,而不是在脚本中运行的原因。

ps。 vsc 只是一个编辑器,所以你不能使用 vsc 来执行 python。您正在使用自己的 python 程序执行 python 脚本。