0

I have such a dataframe:

TST           DELTA KEY
2021.10.03 0024 0   1
2021.10.03 0024 1   2
2021.10.03 0025 1   1
2021.10.03 0025 2   2

What I want to get is such a dataframe:

TST           KEY1  KEY2
2021.10.03 0024 0   1
2021.10.03 0025 1   2

That means, I would like to get the values in the KEY column as suffixes for the new KEY1, KEY2 etc columns and the entries of the DELTA column as values for the new KEY1, KEY2 columns. And only one row for each timestamp instead of several rows for each KEY.

How could I do this?

Tobitor
  • 1,080
  • 9
  • 29

0 Answers0