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

0

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 ("can not handle a non-unique multi-index!")

     

Exception: can not handle a non-unique multi-index!

    
asked by anonymous 16.02.2017 / 15:30

0 answers