gpt4 book ai didi

Python seaborn 图形

转载 作者:行者123 更新时间:2023-12-05 07:50:12 28 4
gpt4 key购买 nike

亲爱的,我正在尝试将 kaggle 教程代码应用于 Iris 数据集。

不幸的是,当我执行图表的代码时,我只能看到这个输出而看不到任何图表:

matplotlib.axes._subplots.AxesSubplot 位于 0x9abf9b0

有什么想法吗?

这是代码

import warnings # current version of seaborn generates a bunch of warnings that we'll ignore
warnings.filterwarnings("ignore")
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", color_codes=True)

# Next, we'll load the Iris flower dataset, which is in the "../input/" directory
iris = pd.read_csv("../input/Iris.csv") # the iris dataset is now a Pandas DataFrame

# We'll use this to make a scatterplot of the Iris features.
iris.plot(kind="scatter", x="SepalLengthCm", y="SepalWidthCm")

最佳答案

如果您使用的是 IPython Notebook,只需在绘制绘图之前使用 %pylab inline 命令。如果没有,请在完成绘图后尝试 plt.show()

关于Python seaborn 图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36454951/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com