What could cause a plot fail in my code?
Denis McMahon
denismfmcmahon at gmail.com
Tue Dec 22 09:12:43 EST 2015
On Mon, 21 Dec 2015 09:15:38 -0800, Robert wrote:
> Hi,
>
> I find a useful code snippet on link:
>
> http://stackoverflow.com/questions/25126444/logistic-regression-in-
pymc/34400966#34400966
>
> but it has error on plot function. The error message is as following:
> 6192 ymin = np.amin(m[m != 0])
> 6193 # filter out the 0 height bins
> -> 6194 ymin = max(ymin*0.9, minimum) if not input_empty
> else minimum
> 6195 ymin = min(ymin0, ymin)
> 6196 self.dataLim.intervaly = (ymin, ymax)
>
> UnboundLocalError: local variable 'ymin' referenced before assignment
> /////////////
>
> I have no clue at all on debug it. Could you help me?
> Thanks,
It looks as if ymin may be defined in a conditional block, and you've
managed to reach line 6194 without going through that block.
--
Denis McMahon, denismfmcmahon at gmail.com
More information about the Python-list
mailing list