Spaces:
Sleeping
Sleeping
Update map.py
Browse files
map.py
CHANGED
|
@@ -347,7 +347,7 @@ def filter_dataframe(df: pd.DataFrame) -> pd.DataFrame:
|
|
| 347 |
)
|
| 348 |
df_ = df_[df_[column].between(*user_num_input)]
|
| 349 |
filtered_columns.append(column)
|
| 350 |
-
|
| 351 |
# Chart_GPT = ChartGPT(df_, title_font, body_font, title_size,
|
| 352 |
# colors, interpretation, extract_docx, img_path)
|
| 353 |
|
|
@@ -380,8 +380,9 @@ def filter_dataframe(df: pd.DataFrame) -> pd.DataFrame:
|
|
| 380 |
user_date_input = tuple(map(pd.to_datetime, user_date_input))
|
| 381 |
start_date, end_date = user_date_input
|
| 382 |
df_ = df_.loc[df_[column].between(start_date, end_date)]
|
| 383 |
-
|
| 384 |
date_column = column
|
|
|
|
|
|
|
| 385 |
df_[column] = df_[column].dt.strftime('%Y-%m-%d %H:%M:%S')
|
| 386 |
|
| 387 |
if date_column and filtered_columns:
|
|
@@ -404,8 +405,6 @@ def filter_dataframe(df: pd.DataFrame) -> pd.DataFrame:
|
|
| 404 |
st.pyplot(fig2)
|
| 405 |
except Exception as e:
|
| 406 |
st.error(f"Error plotting bar chart: {e}")
|
| 407 |
-
|
| 408 |
-
|
| 409 |
else:
|
| 410 |
user_text_input = right.text_input(
|
| 411 |
f"Substring or regex in {column}",
|
|
@@ -501,6 +500,8 @@ if my_dataset is not None :
|
|
| 501 |
|
| 502 |
keplergl_static(map_1, center_map=True)
|
| 503 |
st.session_state['map_generated'] = True
|
|
|
|
|
|
|
| 504 |
except Exception as e:
|
| 505 |
st.error(f"An error occurred while reading the file: {e}")
|
| 506 |
else:
|
|
|
|
| 347 |
)
|
| 348 |
df_ = df_[df_[column].between(*user_num_input)]
|
| 349 |
filtered_columns.append(column)
|
| 350 |
+
|
| 351 |
# Chart_GPT = ChartGPT(df_, title_font, body_font, title_size,
|
| 352 |
# colors, interpretation, extract_docx, img_path)
|
| 353 |
|
|
|
|
| 380 |
user_date_input = tuple(map(pd.to_datetime, user_date_input))
|
| 381 |
start_date, end_date = user_date_input
|
| 382 |
df_ = df_.loc[df_[column].between(start_date, end_date)]
|
|
|
|
| 383 |
date_column = column
|
| 384 |
+
|
| 385 |
+
# convert back to str for the map
|
| 386 |
df_[column] = df_[column].dt.strftime('%Y-%m-%d %H:%M:%S')
|
| 387 |
|
| 388 |
if date_column and filtered_columns:
|
|
|
|
| 405 |
st.pyplot(fig2)
|
| 406 |
except Exception as e:
|
| 407 |
st.error(f"Error plotting bar chart: {e}")
|
|
|
|
|
|
|
| 408 |
else:
|
| 409 |
user_text_input = right.text_input(
|
| 410 |
f"Substring or regex in {column}",
|
|
|
|
| 500 |
|
| 501 |
keplergl_static(map_1, center_map=True)
|
| 502 |
st.session_state['map_generated'] = True
|
| 503 |
+
with st.container(border=True):
|
| 504 |
+
st.write("Military Base coordinates approximated from: https://www.dpiarchive.com/ (Archive / UFO Related Secret Facilities / Top Priority Documents / Facilities Map and List.pdf)\n\nNuclear Powerplants from: https://datasets.wri.org/dataset/globalpowerplantdatabase")
|
| 505 |
except Exception as e:
|
| 506 |
st.error(f"An error occurred while reading the file: {e}")
|
| 507 |
else:
|