I have an exel sheet. The first column is time data that starts from 22:35:52 to 4:46:30 with 30 sec intervals. The second column is body temperature data. The part of the sheet is indicated in the image. exel sheet I wanted to resample at 1 sec intervals starting at 22:36:00 and starting at the body temperature at 22:36:00. However, the output was resampled at 1 sec intervals starting at 00:00:00 and starting at the body temperature at 00:00:00.
我试图这样做。
import pandas as pd
#path to the excel file
df = pd.read_excel(R"C:UsersXXX.xlsx", sheet_name="XXX", usecols=[0, 1], index_col=[0], skiprows=[0, 1])
df.index = pd.to_datetime(df.index, format= %H:%M:%S )
df_upsampled = df.resample("1s", origin= start ).asfreq()
print(df_upsampled)
I got this output. output
你们能否向我提出任何建议?