Im trying this code
df_aggregated[['modeWinddirectiondiscrete','CAMPAÑA', 'ID_ESTACION','Month']].pivot_table(index=['CAMPAÑA', 'ID_ESTACION'], columns='Month')
Where the column 'modeWinddirectiondiscrete' have values like "North, West, South, East ..."
And I have as result just the index. I tried it with other numeric columns and works well so the problem is that the column has Strings. Is it possible to have a correct solution with the Strings? or I need to transform the directions to numbers?
EDIT: For example I have this table
mode modeWinddirectiondiscrete CAMPAÑA ID_ESTACION Month
0 South 16 0 1
1 North 16 0 1
2 North 16 0 1
3 East 16 0 2
4 West 16 0 2
5 East 16 0 2
6 South 17 1 3
7 West 17 1 3
8 North 17 1 3
9 West 17 1 3
And i want something like:
DewpointLocalDayAvg
Month 1 10 11 12 2 3 4 5 6 7 8 9
CAMPAÑA ID_ESTACION
16 0 North .............East...........................
17 1 .......................West.......................
The result must be something like that, I don't know if this example is well understood.