How do we calculate net transaction amount after subtracting promotional discounts?
Performing element-wise arithmetic subtraction between two numeric columns using Column operators.
Revenue reconciliation, invoice processing, and financial balance sheet calculations.
from pyspark.sql.functions import col
df = df.withColumn("net_amount", col("gross_amount") - col("discount"))Practice typing production-grade PySpark code for Arithmetic Column Subtraction.