This script is designed to automate the process of loading, visualizing, merging, and exporting multiple Excel datasets using Python. It leverages Pandas for data manipulation, Matplotlib for visualization, and Glob for efficiently handling multiple files.
The workflow begins by importing the required libraries and reading an Excel dataset (fsi-2020.xlsx). The first column is set as the DataFrame index to provide a structured representation of the data.
A selected column from the dataset is then visualized using a line chart, allowing quick exploration of trends and patterns.
Next, the script automatically scans a specified directory for all .xlsx files using the Glob module. Each Excel file is loaded into a DataFrame and combined into a single dataset using pandas.concat(), eliminating the need to merge files manually.
Once the combined dataset is created, the Total column is visualized to provide an overall view of the aggregated data.
Finally, the processed dataset is exported in both Excel and CSV formats, making it ready for further analysis, reporting, or integration with other applications.
- Reads Excel files using Pandas
- Sets the first column as the DataFrame index
- Visualizes selected columns with Matplotlib
- Automatically detects all Excel files in a directory
- Merges multiple datasets into a single DataFrame
- Performs trend visualization on the combined dataset
- Exports processed data to Excel and CSV
- Simple, reusable, and scalable workflow for data preprocessing
⬇️
⬇️
⬇️
⬇️
⬇️
⬇️
⬇️
After successful execution, the script generates:
- visualized_data.xlsx – Processed Excel dataset
- visualized_data.csv – Processed CSV dataset
- Line charts for both individual and combined datasets
This project demonstrates an efficient and scalable approach to data preprocessing, visualization, and dataset consolidation, making it suitable for data analytics, reporting, and exploratory data analysis (EDA) workflows.