что-то вроде этого может работать для вас:
df['date']=pd.to_datetime(df['date']) #not necessary if your dates are already in datetime format
df.set_index('date',inplace=True) #make date the index
all_days=df.index.normalize().unique() #get all unique days in timeseries
df2=pd.DataFrame(columns=['date','percent']) #create new df to store results
df2['date']=all_days #make date column equal to the unique days
df2.set_index('date',inplace=True) #make date column the index
for i,row in df2.iterrows(): #iterate through each row of df2
iloc = df2.index.get_loc(i) #get index location
daily_df = df[(df.index >= df2.index[iloc]) & (df.index < df2.index[iloc+1])] #get reduced df for that day (assuming it starts at midnight and ends at 23:59:59)
total_count = daily_df.shape[0] #number of temp readings that day
above_count = daily_df[(daily_df['temp'] >= 10) & (daily_df['temp'] <= 20)].values.shape[0] #number of temp readings between 10 and 20
df2.iloc[iloc]['percent']=100*above_count/total_count #assign percent column the percentage of values between 10 and 20
определенно есть способ свести код с помощью функций панд, о которых я не знаю ... но это хорошее начало
вам придется обрабатывать последний день, так как у него не будет конечного конечного дня
РЕДАКТИРОВАТЬ
заменить строку daily_df на:
daily_df = df[df.index.normalize() == df2.index[iloc]]
и не будетпадение в последний день