python - 熊猫,将两列中的字符串组合为绘图中的刻度值
问题描述
我需要barh
从熊猫数据框中绘制。但是,因为y_ticks
我想要另一列的索引 + 字符串。索引有德语单词,另一列有英文翻译。
这是我的数据框:
count eng
-----------------
seit 12 since
mehr 11 more
目前我有这个情节:
df.sort_values('count').plot.barh(figsize=(15, 8)).grid(axis='x')
plt.ylabel('Most common words')
plt.xlabel('number of Occurances')
这将索引作为刻度,我想要索引加上eng
列中的值,可能在索引值之下,如下所示:
(seit)
since
我如何实现这一目标?
提前致谢!
解决方案
推荐阅读
- javascript - 如何在自定义轮播上创建点?
- azure-data-factory - ADF 中的一个表达式生成器中的两个表达式
- r - 不同计算机上的回归输出不同
- pyspark - Azure Synpase - PySpark 地理处理形状文件
- ios - Cocoapods 安装权限错误有点严重
- python - 从列中随机选择值,然后在 Python 的另一列中删除具有该值的行
- json - Perl:来自导入 JSON 数据的哈希,Dumper 输出正确的数据,但是我无法访问它
- python - 已经在使用fillna,但在python中仍然有空值
- python - Tensorflow Keras 交叉熵损失与输出上的线性激活
- c++ - Count number of matching bytes between two _m128i SIMD vectors