Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1175,6 +1175,10 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1175 |
# 1. Drop the original first column
|
1176 |
if len(df.columns) > 1:
|
1177 |
# Skipping the original first column
|
|
|
|
|
|
|
|
|
1178 |
limited_data = df.head(3)
|
1179 |
limited_data_without_first_column = limited_data.iloc[:, 1:]
|
1180 |
else:
|
@@ -1195,6 +1199,7 @@ def handle_large_dataset(df, create_document,isDataFrame):
|
|
1195 |
|
1196 |
file_path = "output_data.xlsx"
|
1197 |
#file_path = os.path.join(current_folder, 'output_data.xlsx')
|
|
|
1198 |
df.to_excel(file_path, index=False)
|
1199 |
|
1200 |
|
|
|
1175 |
# 1. Drop the original first column
|
1176 |
if len(df.columns) > 1:
|
1177 |
# Skipping the original first column
|
1178 |
+
# List of required columns
|
1179 |
+
required_columns = ['Broker Name', 'Account Number', 'Employee name', 'Account Owner', 'Account ID']
|
1180 |
+
# Filter the DataFrame to include only the required columns
|
1181 |
+
df = df[required_columns]
|
1182 |
limited_data = df.head(3)
|
1183 |
limited_data_without_first_column = limited_data.iloc[:, 1:]
|
1184 |
else:
|
|
|
1199 |
|
1200 |
file_path = "output_data.xlsx"
|
1201 |
#file_path = os.path.join(current_folder, 'output_data.xlsx')
|
1202 |
+
#Broker Name, Account Number, Employee name,Account Owner,Account ID
|
1203 |
df.to_excel(file_path, index=False)
|
1204 |
|
1205 |
|