Histogram `bins` must increase monotonically matplotlib

自作多情 提交于 2021-02-11 13:12:58

问题


this is my code:

import numpy as np
import matplotlib.pyplot as plt

data = np.genfromtxt("C:\\Users\\pearl\\Downloads\\Age group.csv",
        delimiter=',',
        names=True, dtype=('U7','U40','U13',int))

x= ['15-19','20-24', '25-29','30-34','35-39','40-44']
y = data[data['birth_type'] == 'Single Birth']['total_number_of_mother']

plt.hist(x,y)
plt.show()

However, I am getting a value error saying bins must increase monotonically. May I get some help?

来源:https://stackoverflow.com/questions/65263726/histogram-bins-must-increase-monotonically-matplotlib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!