I have a CSV file which I need to perform the reverse of a melt on, the dataframe looks like this:
Date/Time Identifier Value
2023-01-01 A 100
2023-01-02 B 75
2023-01-03 A 23
I need to keep the date\time column as is, but there will sometimes be missing values for some columns when the dataframe
is changed, so the output would look like the following, where each unique Identifier
value becomes a column.
Date/Time A B
2023-01-01 100
2023-01-02 75
2023-01-03 23
I recently asked for some help with converting a file in the output I expect to a CSV style and this was using a function called melt()
which works well in that use case, but I now need to perform the reverse of this by sort of hoisting the row values up to become columns.