In need to create a new column which will merge all month columns and display their values as an array of key-values pairs.
I was already able to merge the columns:
df["Consumo"] = df.iloc[:,[4,5,6,7,8,9,10,11,12,13,14,15]].values.tolist()
I'm just not sure how I'm supposed to map through the values first in order to arrange the key-values array.
Sure, I could iterate over each column and then iterate over each row, but it would take take me somehow to keep the values and then push into an array of arrays... I thought about something like that, I could keep this huge array of arrays and then push it into the df["Consumo"], would that work?
Input Data:
Cód. Perfil Sigla Nome Empresarial ... 2020-10-01 00:00:00 2020-11-01 00:00:00 2020-12-01 00:00:00 ...
3 RGE SUL RGE SUL DISTRIBUIDORA DE ENERGIA S.A. ... 230357.542859 284340.749249 337758.293447 ...
Expected Output:
Cód. Perfil Sigla Nome Empresarial Patamar Consumo
3 RGE SUL RGE SUL DISTRIBUIDORA DE ENERGIA S.A.LEVE [2020-10-01 00:00:00: 375637.681828, 2020-10-01 00:00:00: 350523.989792, 2020-10-01 00:00:00: 314549.742607, ...