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.
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.