I have the following Pandas Dataframe:
Id Values Hour
ES0024 4000 01:00
ES0024 5000 03:00
ES0024 6000 04:00
ES0024 7000 05:00
ES0024 8000 06:00
ES0024 9000 08:00
Want I want to do is to construct a json doc with the following output:
{"Id": "ES0024", "Values": [4000, None, 5000, 6000, 7000, 8000, None, 9000]}
So that if the corresponding position of the hour in the array of values is empty, a None value is entered.
Thank you very much!