1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] TypeError: Cannot interpret '1' as a data type Python

Discussão em 'Python' iniciado por Stack, Abril 7, 2025.

  1. Stack

    Stack Membro Participativo

    I get the error "TypeError: Cannot interpret '1' as a data type" For the following code chunk,

    for j in range (T):
    V_j=V[:,:,j]
    'Check positive definiteness using Cholesky decomposition.'
    'Also check the reciprocal condition number.'
    try:
    np.linalg.cholesky(V_j)
    except np.linalg.LinAlgError:
    Flag = 1
    break
    --> rcond = 1 / np.linalg.cond(V_j)
    if rcond < 1e-15:
    Flag = 1
    break




    should I change 1 in rcond = 1 / np.linalg.cond(V_j) for np.zeros(shape, dtype=float, order='C')?

    np.zeros(shape, dtype=float, order='C')

    Continue reading...

Compartilhe esta Página