Prompt
Analyze the provided Python script that processes large datasets to identify inefficient algorithms or data structures. Focus on improving time complexity and memory usage. Provide specific recommendations to optimize the code while ensuring it remains readable and maintainable, suitable for a team of data scientists in a fintech startup in Southeast Asia.