AnalystPath

Classifying Bracing Frames

PandasEasyJunior level~10 min

Problem

A workshop builds triangular bracing frames from three steel struts. The `braces` DataFrame stores one frame per row with the three strut lengths `side_x`, `side_y`, and `side_z` in centimeters. Three lengths only form a real triangle when every side is shorter than the sum of the other two; if any side is greater than or equal to that sum, the struts cannot close into a triangle.

For each frame return a single column `frame_kind`:

- `Open Frame` if the three struts cannot form a triangle.
- `Regular` if all three struts are equal.
- `Balanced` if exactly two struts are equal.
- `Irregular` if all three struts differ.

Return one row per frame in any order.

Input data

Example rows — the live problem includes the full dataset.

braces
side_xside_yside_z
151518
151515
151617
8925

Expected output

Your answer should return 4 rows with the columns frame_kind.

Starter code (Pandas (Python))

import pandas as pd

def classify_braces(braces) -> pd.DataFrame:
    # Your code here
    return braces

Solve this Pandas question free

Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related Pandas questions