Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ import seaborn as sns
|
|
| 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,19 +113,11 @@ with tab1:
|
|
| 114 |
# Immediately rerun the application
|
| 115 |
st.experimental_rerun()
|
| 116 |
|
| 117 |
-
#
|
| 118 |
-
|
| 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 |
-
|
| 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
|
|
|
|
| 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 |
# Immediately rerun the application
|
| 114 |
st.experimental_rerun()
|
| 115 |
|
| 116 |
+
# Get current time in UTC + 2 hours
|
| 117 |
+
now = datetime.now() + timedelta(hours=2) # Get current time
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
yesterday = now - timedelta(days=1)
|
| 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']]
|
| 122 |
|
| 123 |
# Applying StandardScaler
|