1
I have a dataframe with the columns:
LUC
Contrato
Fantasia
Ano
Mes
01
02
03
05
...
30
Tatividade
I need to turn these columns with the days of the month into rows. In each column has the value sold that day by the store. It would have to look like this:
LUC
Contrato
Fantasia
Ano
mes
dia
valor
I tried the code:
vendas = pd.melt(vendas.reset_index(), id_vars=['LUC', 'Contrato','Fantasia','ano','mes','Tatividade'],
var_name='dia', value_name='valor')
The columns were created, but the values were incorrect. In the day column was the index value and in the value column was a sequence.