import pandas as pd
from typing import Any
import csv
import io
def main() -> Any:
# Create a dummy CSV data string with 3 columns
csv_data = """ID;Amount;Status
abc123;1000;completed
def456;2000;pending
ghi789;3000;failed"""
# Use StringIO to treat the string as a file object
csv_file_like_object = io.StringIO(csv_data)
# Read the CSV data into a DataFrame directly
df = pd.read_csv(csv_file_like_object, delimiter=';')
df2 = df[['Status', 'ID', 'Amount']]
# Debugging: Print DataFrame information
print("DataFrame columns:", df2.columns)
print("DataFrame head:\n", df2.head())
# Return the DataFrame
return df2.to_dict('records')
import pandas as pd
from typing import Any
import csv
import io
def main() -> Any:
# Create a dummy CSV data string with 3 columns
csv_data = """ID;Amount;Status
abc123;1000;completed
def456;2000;pending
ghi789;3000;failed"""
# Use StringIO to treat the string as a file object
csv_file_like_object = io.StringIO(csv_data)
# Read the CSV data into a DataFrame directly
df = pd.read_csv(csv_file_like_object, delimiter=';')
df2 = df[['Status', 'ID', 'Amount']]
# Debugging: Print DataFrame information
print("DataFrame columns:", df2.columns)
print("DataFrame head:\n", df2.head())
# Return the DataFrame
return df2.to_dict('records')