【问题标题】:my pandas and seaborn comands not responding我的 pandas 和 seaborn 命令没有响应
【发布时间】:2021-03-10 13:54:55
【问题描述】:

将熊猫导入为 pd

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

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

sbn.pairplot(dataFrame)

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

【问题讨论】:

  • 我3天前下载了anaconda,尝试在vsc上写代码。但是系统给出了关于 anaconda 的错误,所以我删除了 anaconda。但这一次它根本没有响应。
  • 你为什么不在 jupyter notebook 中试试你的代码?
  • 其实我试过了。当我使用 jupyter 时,它确实有效。但我想使用 vsc 但我们到了。

标签: python pandas anaconda


【解决方案1】:

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

import seaborn as sbn 
import matplotlib.pyplot as plt

sbn.pairplot(dataFrame)
plt.show()

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-24
    • 2022-12-15
    • 2021-10-29
    • 2021-11-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多