0

I have a dataframe df1 as

Time               reading
2022-05-02 08:54:48  13
2022-05-02 08:54:49  14
2022-05-02 08:54:51  45
2022-05-02 08:54:53  54

I want to fill the missing time in seconds in Time column, other column the values can be Nan.

Tried with pd.daterange() but not getting desired output.

output expected

     Time               reading
    2022-05-02 08:54:48  13
    2022-05-02 08:54:49  14
    2022-05-02 08:54:50  Nan
    2022-05-02 08:54:51  45
    2022-05-02 08:54:52  Nan
    2022-05-02 08:54:53  54

tried with asfreq mentioned but getting

AttributeError: 'DatetimeIndex' object has no attribute 'asfreq'
Kowsi
  • 164
  • 7

0 Answers0