Pandas in Python: Essential Techniques

Pandas – Part 2

Built-in Functions

  • Average of column: df_grades.Column.mean()
    • Average of multiple columns: df_grades[["column1", "column2"]].mean()
  • Max/min: df_grades["column name"].max() or .min()
  • Statistical summary: df_grades.describe()
    • Can get all key stats for numeric columns at once with the describe() method
      • Count, mean, std, min, 25%, 50%, 75%, max
    • Pick out chunks of the summary by storing the summary in a variable and then use variable[["column name", "column name"]]
  • Number of each unique value:
Read More