Spaces:
Runtime error
Runtime error
| import pandas as pd | |
| def preprocess_data(file_path): | |
| df = pd.read_csv(file_path) | |
| text_data = [] | |
| for index, row in df.iterrows(): | |
| text_data.append(f"Date: {row['Date']}\nDescription: {row['Description']}\nCheck Number: {row['Check Number']}\nAmount: {row['Amount']}\nBalance: {row['Balance']}\n\n") | |
| with open("training_data.txt", "w") as f: | |
| f.writelines(text_data) | |
| if __name__ == "__main__": | |
| preprocess_data("data.csv") | |