calculate total price as quantity * unit_price
This commit is contained in:
@@ -31,8 +31,7 @@ def generate_example_dataset() -> pd.DataFrame:
|
||||
def transform_example_dataset(df: pd.DataFrame) -> pd.DataFrame:
|
||||
"""Applies a simple transformation to the example dataset."""
|
||||
|
||||
df["price_band"] = df["total_price"].apply(
|
||||
lambda value: "high" if value >= 25 else "standard"
|
||||
)
|
||||
df["total_price"] = df["quantity"] * df["unit_price"]
|
||||
|
||||
|
||||
return df
|
||||
|
||||
Reference in New Issue
Block a user