joycecast commited on
Commit
5e86c4d
·
verified ·
1 Parent(s): 1ecc1c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -135,11 +135,14 @@ with tabs[1]:
135
  preview_grouped = df_ctn.groupby(['MAWB', last_mile_col]).size().reset_index(name='CTN Count')
136
  st.dataframe(preview_grouped, use_container_width=True)
137
 
138
- # Grouped Summary: only for Last Mile Service == GOFO, grouped by MAWB + Channal_name
139
- st.subheader("GOFO Each Channel Cartons Summary")
140
  if 'Channal_name' in df_ctn.columns:
141
- df_gofo = df_ctn[df_ctn[last_mile_col].str.upper() == 'GOFO']
142
- grouped = df_gofo.groupby(['MAWB', 'Channal_name']).size().reset_index(name='CTN Count')
 
 
 
143
  st.dataframe(grouped, use_container_width=True)
144
  else:
145
  st.warning("Column 'Channal_name' not found in the uploaded file(s). Please ensure this column exists.")
 
135
  preview_grouped = df_ctn.groupby(['MAWB', last_mile_col]).size().reset_index(name='CTN Count')
136
  st.dataframe(preview_grouped, use_container_width=True)
137
 
138
+ # Grouped Summary: for Last Mile Service == GOFO/USPS, grouped by MAWB + Channal_name
139
+ st.subheader("GOFO/USPS Each Channel Cartons Summary")
140
  if 'Channal_name' in df_ctn.columns:
141
+ df_channel = df_ctn[
142
+ (df_ctn[last_mile_col].str.upper() == 'GOFO') |
143
+ (df_ctn[last_mile_col].str.upper() == 'USPS')
144
+ ]
145
+ grouped = df_channel.groupby(['MAWB', 'Channal_name']).size().reset_index(name='CTN Count')
146
  st.dataframe(grouped, use_container_width=True)
147
  else:
148
  st.warning("Column 'Channal_name' not found in the uploaded file(s). Please ensure this column exists.")