← Boston Consulting Group Interview Insights
The actual pandas steps are not the hard part.
Start by loading both CSV files with pandas, then inspect their column names to identify inconsistencies. Define a mapping from each file's columns to a common schema, rename the columns, cast the amount column to float, and finally concatenate the DataFrames. Emphasize data validation and handling edge cases like missing values or type conversion errors.
Pro tip: Use a configuration-driven approach for column mapping to make the solution scalable and maintainable, and always validate data after concatenation to catch issues early.
Read both CSV files into pandas DataFrames and examine their column names, data types, and sample rows to understand the inconsistencies.
Determine the target column names and create a mapping dictionary for each file that translates its columns to the common schema.
Rename columns using the mapping and convert the amount column to float, handling any conversion errors or missing values appropriately.
Concatenate the standardized DataFrames into one, then validate the result by checking shape, data types, and summary statistics.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.