Extract data from multiple formats (CSV + JSON), clean nulls and anomalies, map joins on relational keys, perform wide-to-long table reshaping, and export reusable pipeline modules.
Domain / Environment
Customer Analytics / Conda VM
Difficulty
Intermediate (3/5)
Course Module
Data Collection & Wrangling
Deliverables
Cleaned dataset file & Verification Script
1. System Architecture & Process Workflow
The diagram below displays the ETL (Extract, Transform, Load) pipelines architecture. Order logs (CSV) and customer profiles (JSON) are parsed into temporary dataframes. A pipeline function joins tables on matching IDs, handles missing values and outliers, shapes tables via pivots, and saves the cleaned dataset.
2. Part 1: Step-by-Step Action Items & Key Execution Steps
STEP 1
Activate Python Virtual Environment
Point the terminal execution environment to the course conda sandbox environment.
$ conda activate ds_ai_ml
This action redirects active library pathways to the virtual environment directory folders.
STEP 2
Create Project Folders inside Linux VM
Create a dedicated folder for the project files inside your guest VM home folder directory.
$ mkdir -p ~/Projects/data_wrangling && cd ~/Projects/data_wrangling
This creates the project workspace and shifts the active terminal context into it.
STEP 3
Create Raw Orders CSV Log
Create a CSV dataset containing raw transaction logs, item counts, and pricing.
$ nano orders.csv
This opens nano editor. Paste the CSV data template from Part 2, press **Ctrl + O** and **Enter** to save, and **Ctrl + X** to exit.
STEP 4
Create Raw Customer Profiles JSON File
Create a JSON file containing user profile records, email listings, and signup dates.
$ nano customers.json
This opens nano editor. Paste the JSON template from Part 2, press **Ctrl + O** and **Enter** to save, and **Ctrl + X** to exit.
STEP 5
Create pipeline script file in VS Code
Launch VS Code and create a new script file inside the project workspace folder.
Launch VS Code via terminal "code ." -> Right-click in explorer tree -> click New File -> Type: wrangle_pipeline.py -> Press Enter
This registers an empty file `wrangle_pipeline.py` inside the active directory editor workspace.
STEP 6
Load Pipeline compilation logic
Paste the data cleaning and transformation code into the newly created python script file.
Click wrangle_pipeline.py -> Paste python code from Part 2 below -> Save file via Ctrl + S
This writes the ETL transformation commands to the code file.
STEP 7
Execute pipeline logic script
Run the validation script using the python engine to compile the datasets.
$ python wrangle_pipeline.py
This runs the pipeline, merging the sources, cleaning anomalies, pivoting data, and saving the output to `cleaned_customer_data.csv`.
3. Operational Pipeline Architecture
The flowchart below outlines the data wrangling pipeline. It details the steps from extracting orders and customer profiles to data cleansing, merging tables on relational keys, reshaping, and exporting the final dataset.
4. Part 2: Complete Deliverable Assets & Production Templates
To run the wrangling pipeline, we need orders CSV data, customer JSON data, and python script logic. Below is a line-by-line explanation of the code, followed by the combined template files.
Step-by-Step Code Construction
Lines 1 - 4
Import tabular packages
Include system OS and Pandas libraries in the code script.
import pandas as pd
import numpy as np
import os
These imports check system paths and load Pandas/NumPy packages for data manipulation.
Lines 5 - 12
Define loading paths & load datasets
Locate the files and read the raw datasets into Pandas DataFrames.