python - 频率 Seaborn 计数图
问题描述
这是一些基本的代码示例:
import seaborn as sns
titanic = sns.load_dataset("titanic")
ax = sns.countplot(x="class", hue="who", data=titanic)
对于变量“类”的每个标签,我想要的只是比方说人的频率历史。
例如,对于 "class"="First",我们应该让男性的比例等于 110/(110+90+5) 。
seaborn可以吗?谢谢
解决方案
推荐阅读
- ruby-on-rails - 从控制器创建子关联
- c# - 瓷砖和 MouseState MonoGame 的更新时间很慢
- flutter - _CastError(用于空值的空检查运算符)尝试播放歌曲时
- javascript - '也许推'的Javascript声明/不可变版本?
- linux - 标准 GNU 风格的关键字选项
- python - 如何限制文本文件中字符串的数量
- javascript - Javascript - 为函数参数中的对象可选字段设置默认值
- c++ - VS Code Mac OS Monterey 构建问题
- git - 如何将存储库直接上传到 GitHub 组织?
- node.js - 用节点编码单引号