votes up 1

Modes must be integers.

Package:
scipy
github stars 8546
Exception Class:
ValueError

Raise code

""" 
           Functions", John Wiley and Sons, 1996.
           https://people.sc.fsu.edu/~jburkardt/f_src/special_functions/special_functions.html

    """
    if not (isscalar(m) and isscalar(n) and isscalar(c)):
        raise ValueError("Arguments must be scalars.")
    if (n != floor(n)) or (m != floor(m)):
        raise ValueError("Modes must be integers.")
    if (n-m > 199):
        raise ValueError("Difference between n and m is too large.")
    maxL = n-m+1
    return specfun.segv(m, n, c, 1)[1][:maxL]


def obl_cv_seq(m, n, c):
😲 Agile task management is now easier than calling a taxi. #Tracklify
🙏 Scream for help to Ukraine
Today, 2nd July 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too! We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Ways to fix

votes up 2 votes down

mode should be an integer

Reproducing the error:

$ pipenv install scipy

$ pipenv shell

from scipy import special
prol = special.pro_cv_seq(0.5,3,1)
print(prol)

---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

<ipython-input-18-3a80c8a7b40d> in <module>()
      1 from scipy import special
----> 2 prol = special.pro_cv_seq(0.5,3,1)
      3 print(prol)


/usr/local/lib/python3.7/dist-packages/scipy/special/_basic.py in pro_cv_seq(m, n, c)
   2137         raise ValueError("Arguments must be scalars.")
   2138     if (n != floor(n)) or (m != floor(m)):
-> 2139         raise ValueError("Modes must be integers.")
   2140     if (n-m > 199):
   2141         raise ValueError("Difference between n and m is too large.")


ValueError: Modes must be integers.

Fixed:

 from scipy import special
prol = special.pro_cv_seq(0,3,1)
print(prol)

[ 0.31900006 2.59308458 6.5334718 12.51446215]

Sep 19, 2021 kellemnegasi answer
kellemnegasi 30.0k

Add a possible fix

Please authorize to post fix