python - 创建包含两列数据框的 seaborn 直方图
问题描述
我尝试使用此数据框显示直方图。
gr_age weighted_cost
0 1 2272.985462
1 2 2027.919360
2 3 1417.617779
3 4 946.568598
4 5 715.731002
5 6 641.716770
我想使用gr_age
column 作为 X 轴和weighted_cost
Y 轴。这是我正在使用 Excel 查找的示例:
我尝试使用以下代码和discrete=True
,但它给出了另一个结果,而且我在使用 displot 时并没有做得更好。
sns.histplot(data=df, x="gr_age", y="weighted_cost")
plt.show()
谢谢你的想法!
解决方案
推荐阅读
- java - 无法在没有空引用错误的情况下调用新片段
- sql - 我的 PL/SQL 过程异常似乎不起作用
- prolog - Prolog中的动态联合查找算法
- javascript - 将链接从 JSON 传递到 React
- linux - 通过将 2 个日期与 Bash 进行比较来创建用户
- dialogflow-es - 与谷歌助手的帐户链接没有在 apprequest 中获取 accessToken
- python - 50013: Missing Permissions - Discord bot 无法禁止/踢出即使是最高优先级的角色,以及给予他们的每一个权限
- python-3.x - Pytorch:为什么在 DDP 中记录失败?
- javascript - 只复制EventEmitter的原型是Nodejs中继承EventEmitter的好方法
- mysql - 在 Xampp 上查找丢失的 mysql 数据库