Spaces:
Running
Running
salomonsky
commited on
Commit
•
f90edf8
1
Parent(s):
5237f23
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
import math
|
@@ -14,6 +15,9 @@ def read_file(file):
|
|
14 |
else:
|
15 |
st.error("Unsupported file format. Please upload a CSV or Excel file.")
|
16 |
return None
|
|
|
|
|
|
|
17 |
return data
|
18 |
except Exception as e:
|
19 |
st.error(f"Error reading file: {e}")
|
@@ -120,4 +124,4 @@ def main():
|
|
120 |
|
121 |
if __name__ == "__main__":
|
122 |
st.set_page_config(page_title="My Analytics App")
|
123 |
-
main()
|
|
|
1 |
+
import os
|
2 |
import streamlit as st
|
3 |
import pandas as pd
|
4 |
import math
|
|
|
15 |
else:
|
16 |
st.error("Unsupported file format. Please upload a CSV or Excel file.")
|
17 |
return None
|
18 |
+
# Guardar el archivo en el directorio actual
|
19 |
+
with open(file.name, "wb") as f:
|
20 |
+
f.write(file.getbuffer())
|
21 |
return data
|
22 |
except Exception as e:
|
23 |
st.error(f"Error reading file: {e}")
|
|
|
124 |
|
125 |
if __name__ == "__main__":
|
126 |
st.set_page_config(page_title="My Analytics App")
|
127 |
+
main()
|