This error happens when I run the program on Ubuntu, and Win10 works normal. What to do?

Asked

Viewed 45 times

1

Program

def trabaLinhas(caminho):
    colunas = extraindoZip.listaArq(caminho)[1]
    dadosV = pd.DataFrame(columns=colunas)
    for coluna in colunas:
        listaLinhas = lerTxt(caminho, coluna)
        dadosVazao = []
        count = 0
    for linha in listaLinhas:
        count += 1
        if count == 1:
            indiceCodigo = linha.index("EstacaoCodigo")
            inicioVa = linha.index("Vazao01")
            indiceData = linha.index("Data")
            indiceCons = linha.index("NivelConsistencia")
        elif count >= 2:
            codigoEst = linha[indiceCodigo]
            data = pd.to_datetime(linha[indiceData], dayfirst=True)
            dias = ca.monthrange(data.year, data.month)[1]
            listaData = pd.date_range(data, periods=dias, freq="D")
            listaCons = [int(linha[indiceCons])]*dias
            indexMult = list(zip(*[listaData, listaCons]))
            index = pd.MultiIndex.from_tuples(indexMult, names=["Data", "Consistencia"])
            indiceVa = [i for i in range(inicioVa, inicioVa+dias)]
            listaVazao = [np.NaN if linha[i] == "" else  float(linha[i].replace(",",".")) for i in indiceVa]
            dadosVazao.append(pd.Series(listaVazao, index=index))

    dadosV[coluna] = pd.concat(dadosVazao)
return dadosV

File "/home/Clebson/miniconda3/lib/python3.5/site-Packages/pandas/core/Generic.py", line 2272, in _reindex_axes tolerance=tolerance, method=method)

File "/home/Clebson/miniconda3/lib/python3.5/site-Packages/pandas/Indexes/multi.py", line 1516, in reindex raise Exception("cannot Handle a non-unique multi-index!")

Exception: cannot Handle a non-unique multi-index!

  • Put the error message together. "This error" is very vague.

  • I just posted, I forgot.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.