🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEpandas

pandas Documentation

📖 INDEX

No matches found.
LOADING ENGINE...

df.agg()

AI & DATA SCIENCE // df-agg

Aggregate using one or more operations over the specified axis.

Syntax

res = df.agg({'A': 'sum', 'B': 'mean'})

Examples

Example 01Basic Usage
res = df.agg({'A': 'sum', 'B': 'mean'})

Best Practices

  • Use vectorized operations over iterations (e.g. iterrows()) for performance.
  • Always verify memory usage when loading large files.