Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Merges pandas DataFrames from multiple construction sources, reconciling differing schemas, keys, and data quality issues.
50% 73%+23 ptsof test cases passed
Passed 16 of 22 test cases with the skill, and 11 of 22 without it.
3 of 3 safety checks passed
Not used yet
Construction projects combine data from BIM, schedules, costs, and sensors. This skill merges DataFrames from disparate sources with intelligent key matching and schema reconciliation.
import pandas as pd
import numpy as np
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass
from enum import Enum
from difflib import SequenceMatcher
class MergeStrategy(Enum):
"""DataFrame merge strategies."""
INNER = "inner" # Only matching rows
LEFT = "left" # All left, matching right
RIGHT = "right" # Matching left, all right
OUTER = "outer" # All rows from both
CROSS = "cross" # Cartesian product
@dataclass
class MergeResult:
"""Result of merge operation."""
merged_df: pd.DataFrame
matched_rows: int
left_only: int
right_only: int
merge_quality: float # 0-1 score
class ConstructionDFMerger:
"""Merge DataFrames from construction sources."""
# Common construction column name mappings
COLUMN_MAPPINGS = {
Next to this one in the catalogue, plus more from the same author.