I´m spending a lot of time trying to set my panel data.
Everytime that I run the following command df.set_index(['id', 'datas'] I have the message that "None of ['id', 'datas'] are in the columns", as show below, but they are.
What´s happening? Someone can help me?
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-4-219574cda450> in <module>
1 # Configurando o painel
----> 2 df.set_index(['id', 'datas'], inplace=True)
3
4 # Realizando a regressão POLS
5 X_pols = df[['perc_qtd_neg_lei', 'ampl_log_0', 'distperc_vwap_inicio_lei', 'segunda', 'terca', 'quarta', 'sexta']]
~\anaconda3\lib\site-packages\pandas\core\frame.py in set_index(self, keys, drop, append, inplace, verify_integrity)
4549
4550 if missing:
-> 4551 raise KeyError(f"None of {missing} are in the columns")
4552
4553 if inplace:
KeyError: "None of ['id', 'datas'] are in the columns"
print(df.columns)?