[Python] df.to_json output appears to skip a date that is in the dataframe

Discussão em 'Python' iniciado por Stack, Junho 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have very limited knowledge of pandas.

    The data I'm using covers 2 dst (daylight saving) transitions for the UK (from 1 Sep 24 to 30 Apr 25), and consist of timestamps in milliseconds with values. The transition dates are 27 Oct 24 and 30 Mar 25.

    Using df.resample and a rule of 86400000ms I resample the data to get one value per day.

    If I then log the dataframe data I appear to have one value per day, with no omitted/missing days in the period.

    I then use df.to_json to convert the data to json.

    The resulting json data does not have a data point for the date 30th March 25. The value for the 30th is instead been given against the timestamp for the 31st.

    Any help much appreciated.

    Continue reading...

Compartilhe esta Página