Skip to content
Advertisement

Manipulating DataFrame

I have the following dataframe df where there are 3 columns: Date, value and topic. I want to create a new dataframe df1 where the topic is the column and is indexed by day, and each topic has its own value per day. My problem is that I don’t know how to match the value to the topic per day. Any help would be appreciated.

JavaScript

Advertisement

Answer

JavaScript

Output

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement