python - Histogram returning inf values -


i trying plot histogram of data, data looks quite ok me.

however histogram not being showed, , returning inf values. not understand why.

here doing:

a sample of data plot:

>>>y[0:20] array([  9.03061197,  11.18613147,  10.20833309,  10.52459041,         12.35042774,  10.94318214,  11.47863285,  11.03543313,         11.51063833,  11.40573821,  10.91732319,  11.2765148 ,         11.73077009,  10.19453873,  10.7591238 ,   9.77956991,          9.7284345 ,  11.8031496 ,  11.11313849,   9.46416353]) 

then using matplotlib hist:

>>> matplotlib.pyplot.hist(y,50) (array([-1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,         0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,         0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,         0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.]), array([ nan,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,         inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,         inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,         inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,  inf,         inf,  inf,  inf,  inf,  inf,  inf,  inf]), <a list of 50 patch objects>) 

i not understand going on.

i thought did understand hist function.

i have used many different bins, not working.

i have tried plot array y using normal plot:

>>>plot(y) 

enter image description here

i appreciate comment or suggestion.

you have irrational number in y array nan or inf. didn't post of values, have check yourself.

you can by:

pylab.isnan(y).any() , pylab.isinf(y).any()

good luck


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -