AI engineering glossary · NumPy pandas visualization

What is transform?

transform: A pandas method that returns a result with the same length as the original data, after computing a per-group or per-column calculation. It is used to add group-level values back onto each row, such as a row's share of its group total.

Level: advancedTopic: NumPy pandas visualization

transform: an example

df['share'] = df['sales'] / df.groupby('city')['sales'].transform('sum') gives each sale as a fraction of its city's total.

Related terms

More NumPy pandas visualization terms

Where you learn it

transform is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.