Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100727

Re: What could cause a plot fail in my code?

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: What could cause a plot fail in my code?
Date 2015-12-22 14:12 +0000
Organization A noiseless patient Spider
Message-ID <n5bloq$v26$1@dont-email.me> (permalink)
References <22c809c7-3aaf-4439-b919-8de982d7ffc9@googlegroups.com>

Show all headers | View raw


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@gmail.com

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

What could cause a plot fail in my code? Robert <rxjwg98@gmail.com> - 2015-12-21 09:15 -0800
  Re: What could cause a plot fail in my code? Robert <rxjwg98@gmail.com> - 2015-12-21 09:29 -0800
    Re: What could cause a plot fail in my code? Peter Pearson <pkpearson@nowhere.invalid> - 2015-12-21 17:54 +0000
  Re: What could cause a plot fail in my code? Peter Otten <__peter__@web.de> - 2015-12-21 19:10 +0100
  Re: What could cause a plot fail in my code? Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-22 14:12 +0000

csiph-web