Merged in feature/postprocess-script (pull request #843)
Add postprocess script * Add postprocess script Approved-by: Siddhant Medar
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
import pandas as pd
|
||||||
|
from constants.constants import Constants
|
||||||
|
from src.investment.postprocess import postprocess
|
||||||
|
|
||||||
|
# File paths
|
||||||
|
input_excel_path = "input.xlsx"
|
||||||
|
output_csv_path = "output.csv"
|
||||||
|
|
||||||
|
# Read Excel file into DataFrame
|
||||||
|
print(f"Reading Excel file: {input_excel_path}")
|
||||||
|
df = pd.read_excel(input_excel_path, dtype=str)
|
||||||
|
print(f"Loaded {len(df)} rows from Excel")
|
||||||
|
|
||||||
|
# Initialize Constants
|
||||||
|
constants = Constants()
|
||||||
|
|
||||||
|
# Process the DataFrame
|
||||||
|
print("Processing data through postprocess()...")
|
||||||
|
df_processed = postprocess(df, constants)
|
||||||
|
print(f"Processing complete. Output has {len(df_processed)} rows")
|
||||||
|
|
||||||
|
# Write to CSV
|
||||||
|
print(f"Writing CSV file: {output_csv_path}")
|
||||||
|
df_processed.to_csv(output_csv_path, index=False)
|
||||||
|
print("Done!")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user