熊猫:绘制所有Y列与一个X列

发布于 2025-02-09 06:44:27 字数 166 浏览 0 评论 0原文

如何在同一图中绘制所有Y列与Excel表中的一个X列,如下图所示?在真实的Excel表中,有近30列。

数据和图片示例

How can I plot all Y columns vs one X column in an excel sheet, all in the same plot, as show in the picture below? In the real excel sheet, there are close to 30 columns.

Data and picture example

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦幻的味道 2025-02-16 06:44:27

只需将列名替换为数据集中的适当列:

df = pd.read_csv("your_csv_file_here")
df = df.set_index("name_of_X_column")
df.plot()

Just replace the column name to the appropriate columns in your dataset:

df = pd.read_csv("your_csv_file_here")
df = df.set_index("name_of_X_column")
df.plot()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文