Issue
Any idea why my histogram turns out with the bars all at the same height ( yaxis 0.10)?
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
np_lst = [33.48722283633526, 16.015345601144418, 7.9556538136419785, 7.146108329540282, 7.087586969243774, 6.9575395019182, 6.01144417712465, 5.939918070095585, 5.5530268548020025, 3.8461538461538463]
a = np.array([np_lst])
fig, ax = plt.subplots(figsize = (20,7))
ax.hist(a, bins = [0,10,20,30,40])
Solution
I think, You don't need the array:
fig, ax = plt.subplots(figsize = (20,7))
ax.hist(np_lst, bins = [0,10,20,30,40])
Answered By - Luis Alejandro Vargas Ramos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.