Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,7 @@ import seaborn as sns
|
|
| 13 |
import time
|
| 14 |
import random
|
| 15 |
from sklearn.preprocessing import StandardScaler
|
|
|
|
| 16 |
|
| 17 |
# Configuring the web page and setting the page title and icon
|
| 18 |
st.set_page_config(
|
|
@@ -113,9 +114,13 @@ with tab1:
|
|
| 113 |
# Immediately rerun the application
|
| 114 |
st.experimental_rerun()
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
df_specific_time_range = building_new[(building_new['time'] >= yesterday) & (building_new['time'] <= now)]
|
| 121 |
data_to_normalize = df_specific_time_range[['x', 'y', 'z']]
|
|
|
|
| 13 |
import time
|
| 14 |
import random
|
| 15 |
from sklearn.preprocessing import StandardScaler
|
| 16 |
+
import pytz
|
| 17 |
|
| 18 |
# Configuring the web page and setting the page title and icon
|
| 19 |
st.set_page_config(
|
|
|
|
| 114 |
# Immediately rerun the application
|
| 115 |
st.experimental_rerun()
|
| 116 |
|
| 117 |
+
# Define Copenhagen time zone
|
| 118 |
+
copenhagen_tz = pytz.timezone('Europe/Copenhagen')
|
| 119 |
+
|
| 120 |
+
# Get current time in Copenhagen
|
| 121 |
+
now_utc = datetime.now(pytz.utc)
|
| 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']]
|