James McCool commited on
Commit
cadc1d7
·
1 Parent(s): 488d713

Remove unnamed columns from uploaded DataFrame in load_file.py: enhance data cleanliness by dropping columns with 'Unnamed' in their names before further processing.

Browse files
Files changed (1) hide show
  1. global_func/load_file.py +4 -0
global_func/load_file.py CHANGED
@@ -24,6 +24,10 @@ def load_file(upload):
24
  st.error('Please upload either a CSV or Excel file')
25
  return None, None
26
 
 
 
 
 
27
  export_df = df.copy()
28
 
29
  for col in df.columns:
 
24
  st.error('Please upload either a CSV or Excel file')
25
  return None, None
26
 
27
+ for col in df.columns:
28
+ if "Unnamed" in col:
29
+ df = df.drop(columns=[col])
30
+
31
  export_df = df.copy()
32
 
33
  for col in df.columns: