Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,30 +6,4 @@ def process_excel(file):
|
|
6 |
return df,type(df)
|
7 |
|
8 |
iface = gr.Interface(fn=process_excel, inputs=gr.File(type='file',label='excle'), outputs=[gr.outputs.Dataframe(type='pandas'),"text"], title="Excel Processor")
|
9 |
-
iface.launch()
|
10 |
-
|
11 |
-
|
12 |
-
# def merge_excel_tables(file_path1, file_path2):
|
13 |
-
# df1 = process_excel(file_path1)
|
14 |
-
# df2 = process_excel(file_path2)
|
15 |
-
# merged_df = df1.merge(df2, left_on=list(df1.columns)[0], right_on=list(df2.columns)[0], how='left')
|
16 |
-
# column_mapping = {}
|
17 |
-
# for col in df1.columns:
|
18 |
-
# column_mapping[col] = col
|
19 |
-
# for col in merged_df.columns:
|
20 |
-
# if col.endswith('_x'):
|
21 |
-
# new_col = col[:-2] # 去除_x后缀
|
22 |
-
# if new_col in column_mapping:
|
23 |
-
# column_mapping[new_col] = new_col # 如果存在相同的列名,保持不变
|
24 |
-
# merged_df.rename(columns={col: new_col}, inplace=True)
|
25 |
-
# elif col.endswith('_y'):
|
26 |
-
# new_col = col[:-2] # 去除_y后缀
|
27 |
-
# merged_df.rename(columns={col: new_col}, inplace=True)
|
28 |
-
# merged_df = merged_df.dropna(axis=1, how='all')
|
29 |
-
# merged_df = merged_df[list(df1.columns)]
|
30 |
-
# # merged_df.to_excel(output_file, index=False)
|
31 |
-
# return merged_df
|
32 |
-
|
33 |
-
|
34 |
-
# iface = gr.Interface(fn=merge_excel_tables, inputs=["file", "file"], outputs=gr.outputs.Dataframe(type='pandas'), title="Excel Processor", description="根据表格一的第一列,寻找表格二对应第一列的行数据,把表格二中与表格一相同标签数据填入表格一")
|
35 |
-
# iface.launch()
|
|
|
6 |
return df,type(df)
|
7 |
|
8 |
iface = gr.Interface(fn=process_excel, inputs=gr.File(type='file',label='excle'), outputs=[gr.outputs.Dataframe(type='pandas'),"text"], title="Excel Processor")
|
9 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|