Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -177,15 +177,24 @@ if uploaded_file is not None:
|
|
| 177 |
ISDs_with_one = ISD_Combined[ISD_Combined['Count'] == 1]
|
| 178 |
if not ISDs_with_one.empty:
|
| 179 |
st.write("ISDs:")
|
| 180 |
-
# st.dataframe(ISDs_with_one[['ISD', 'ISD Code']])
|
| 181 |
st.dataframe(ISDs_with_one[['ISD', 'ISD Code']].reset_index(drop=True))
|
| 182 |
|
| 183 |
# Informing the user about the total number of ISD with a count of 1
|
| 184 |
total_ISDs_with_one = len(ISDs_with_one)
|
| 185 |
st.write(f"Total number of ISD: {total_ISDs_with_one}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
else:
|
| 187 |
-
st.write("No
|
| 188 |
-
|
| 189 |
# call to render Folium map in Streamlit
|
| 190 |
st_data = st_folium(m, width=725)
|
| 191 |
|
|
@@ -198,6 +207,7 @@ if uploaded_file is not None:
|
|
| 198 |
label="Download Map as HTML",
|
| 199 |
data=file,
|
| 200 |
file_name="District_Map.html",
|
| 201 |
-
mime="text/html"
|
|
|
|
| 202 |
)
|
| 203 |
|
|
|
|
| 177 |
ISDs_with_one = ISD_Combined[ISD_Combined['Count'] == 1]
|
| 178 |
if not ISDs_with_one.empty:
|
| 179 |
st.write("ISDs:")
|
|
|
|
| 180 |
st.dataframe(ISDs_with_one[['ISD', 'ISD Code']].reset_index(drop=True))
|
| 181 |
|
| 182 |
# Informing the user about the total number of ISD with a count of 1
|
| 183 |
total_ISDs_with_one = len(ISDs_with_one)
|
| 184 |
st.write(f"Total number of ISD: {total_ISDs_with_one}")
|
| 185 |
+
|
| 186 |
+
# Convert DataFrame to CSV for the download button
|
| 187 |
+
csv = ISDs_with_one.to_csv(index=False).encode('utf-8')
|
| 188 |
+
st.download_button(
|
| 189 |
+
label="Download ISDs to Verify",
|
| 190 |
+
data=csv,
|
| 191 |
+
file_name="ISD_List_to_Verify.csv",
|
| 192 |
+
mime="text/csv",
|
| 193 |
+
key='download-csv'
|
| 194 |
+
)
|
| 195 |
else:
|
| 196 |
+
st.write("No ISDs")
|
| 197 |
+
|
| 198 |
# call to render Folium map in Streamlit
|
| 199 |
st_data = st_folium(m, width=725)
|
| 200 |
|
|
|
|
| 207 |
label="Download Map as HTML",
|
| 208 |
data=file,
|
| 209 |
file_name="District_Map.html",
|
| 210 |
+
mime="text/html",
|
| 211 |
+
type="primary"
|
| 212 |
)
|
| 213 |
|