Annikaijak commited on
Commit
cab7e8e
·
verified ·
1 Parent(s): 14b6fdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -122,7 +122,11 @@ with tab1:
122
  now = now_utc.astimezone(copenhagen_tz)
123
  yesterday = now - timedelta(days=1)
124
 
125
- df_specific_time_range = building_new[(building_new['time'] >= yesterday) & (building_new['time'] <= now)]
 
 
 
 
126
  data_to_normalize = df_specific_time_range[['x', 'y', 'z']]
127
 
128
  # Applying StandardScaler
 
122
  now = now_utc.astimezone(copenhagen_tz)
123
  yesterday = now - timedelta(days=1)
124
 
125
+
126
+ # Ensure the time column in the DataFrame is in datetime format
127
+ building_new['time'] = pd.to_datetime(building_new['time'])
128
+
129
+ df_specific_time_range = building_new[(building_new['time'] >= pd.to_datetime(yesterday)) & (building_new['time'] <= pd.to_datetime(now))]
130
  data_to_normalize = df_specific_time_range[['x', 'y', 'z']]
131
 
132
  # Applying StandardScaler