Skip to content Skip to sidebar Skip to footer

Ploting Matplotlib Histogram In Python

I faced an error when I tried to plot histogram in python. Could you please help me to solve this error? I think it is not a big issue, but I can find the solution yet. :( Code im

Solution 1:

Try to debug your code. You will find y1 is a list of strings, so plt.hist(y1) will raise

TypeError: len() of unsized object

TypeError raised when an operation or function is applied to an object of inappropriate type.

That means you should use float or int, so try to run this:

y1 = [float(interval) for op, response, intervalin pieces]

Post a Comment for "Ploting Matplotlib Histogram In Python"