Skip to content

Content: Vectorization #1

@woozyking

Description

@woozyking

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions