max() error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Patrick C
    New Member
    • Apr 2007
    • 54

    max() error

    I've gotten this exact problem before and I was able to once figure it out. Since then i've apparently forgetten more of the basic.

    Does anyone have any idea whats going on here, because fdayhigh is not an empty list...

    Code:
    >>> import justCup
    Traceback (most recent call last):
      File "<interactive input>", line 1, in <module>
      File "justCup.py", line 63, in <module>
        CupStartIndex = fdayhigh.index(max(fdayhigh))
    ValueError: max() arg is an empty sequence
    >>>
    thanks
  • ilikepython
    Recognized Expert Contributor
    • Feb 2007
    • 844

    #2
    Originally posted by Patrick C
    I've gotten this exact problem before and I was able to once figure it out. Since then i've apparently forgetten more of the basic.

    Does anyone have any idea whats going on here, because fdayhigh is not an empty list...

    Code:
    >>> import justCup
    Traceback (most recent call last):
      File "<interactive input>", line 1, in <module>
      File "justCup.py", line 63, in <module>
        CupStartIndex = fdayhigh.index(max(fdayhigh))
    ValueError: max() arg is an empty sequence
    >>>
    thanks
    Did you try printing fdayhigh before calling max()?

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      Originally posted by ilikepython
      Did you try printing fdayhigh before calling max()?
      That's exactly what I would have said.
      Originally posted by Patrick C
      Does anyone have any idea whats going on here, because fdayhigh is not an empty list...
      You may post the relevant section of that module in order for us to be able to help.

      Comment

      Working...