James McCool
commited on
Commit
·
0926bbb
1
Parent(s):
9a3a501
Refactor salary data processing in load_file.py: remove try-except block for salary conversion, ensuring consistent handling of salary values while maintaining data integrity during file uploads.
Browse files- global_func/load_file.py +2 -5
global_func/load_file.py
CHANGED
|
@@ -24,11 +24,8 @@ def load_file(upload):
|
|
| 24 |
st.error('Please upload either a CSV or Excel file')
|
| 25 |
return None, None
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
st.write('replaced salary symbols')
|
| 30 |
-
except:
|
| 31 |
-
pass
|
| 32 |
|
| 33 |
export_df = df.copy()
|
| 34 |
|
|
|
|
| 24 |
st.error('Please upload either a CSV or Excel file')
|
| 25 |
return None, None
|
| 26 |
|
| 27 |
+
df['salary'] = df['salary'].astype(str).str.replace([',', '$', ' '], '', regex=True)
|
| 28 |
+
st.write('replaced salary symbols')
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
export_df = df.copy()
|
| 31 |
|