joycecast commited on
Commit
a5a5951
·
verified ·
1 Parent(s): 340a0a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -145,7 +145,7 @@ def convert_ci(by_line_item_file, combined_file, password, max_rows):
145
  # Replace the incorrect MID
146
  mapping_df = pd.read_csv("MID_replace.csv")
147
  mid_map = dict(zip(mapping_df["SHEIN_MID_Code"], mapping_df["Replacement"]))
148
- merged_df["MID_Code"] = merged_df["MID_Code"].map(mid_map).fillna(merged_df["MID_Code"])
149
 
150
  # Save merged output partitioned by user-defined max_rows
151
  outputs = []
 
145
  # Replace the incorrect MID
146
  mapping_df = pd.read_csv("MID_replace.csv")
147
  mid_map = dict(zip(mapping_df["SHEIN_MID_Code"], mapping_df["Replacement"]))
148
+ merged_df["MID_Code"] = merged_df["MID_Code"].apply(lambda x: re.sub(r"[^\w]", "", x)).map(mid_map).fillna(merged_df["MID_Code"])
149
 
150
  # Save merged output partitioned by user-defined max_rows
151
  outputs = []