A very useful technique that can often replace the need of expensive iterative flows, widely used in popular solutions such as Pandas DataFrame:
# vectorized operation
df["sum"] = df["a"] + df["b"])
# iterative operation
def["sum"] = df.apply(lambda row: row["a"] + row["b"], axis=1)
A very useful technique that can often replace the need of expensive iterative flows, widely used in popular solutions such as Pandas DataFrame: