1
Hello, I have a table in pandas and need to transform, I believe using the pivot, from a certain column
Month Codigo COD 1 COD 2
0 NaN Date 1 07/05/2018 01/01/2019
1 NaN Date 2 NaN NaN
2 05/2018 0.9 0.9 NaN
3 06/2018 1 1 NaN
4 07/2018 1 1 NaN
I would like that Tabe to have the following output
I tried the code
pd.pivot_table(all_data, values = 'COD 1', index=['Codigo'], columns = 'Month').reset_index()
But returns the following error:
DataError: No numeric types to aggregate
This is the link to my excel, in case you want to take a look
I put the link, thank you
– user223488
you only use
values
when you need to make some kind of aggregation. No need in your case– Lucas
But how do I do the command? because I tried to remove it and am still in error, is it simply remove values? can you please give me an example? Removing values, the error is the same Dataerror: No Numeric types to Aggregate
– user223488