Pandas – Statistical Functions

In this lesson, we will work around statistics operations using the statistical functions in Python Pandas.  It can be applied to a Series or DataFrame.

  • sum(): Return the sum of the values.
  • count(): Return the count of non-empty values.
  • max(): Return the maximum of the values.
  • min(): Return the minimum of the values.
  • mean(): Return the mean of the values.
  • median(): Return the median of the values.
  • std(): Return the standard deviation of the values.
  • describe(): Return the summary statistics for each column.

Pandas sum() method

The sum() method in Python Pandas is used to return the sum of the values. Let us see an example:

Output

Pandas count() method

The count() method in Python Pandas is used to return the count of non-empty values. Let us see an example:

Output

Pandas max() method

The max() method in Python Pandas is used to return the maximum of the values. Let us see an example:

Output

Pandas min() method

The min() method in Python Pandas is used to return the minimum of the values. Let us see an example:

Output

Pandas mean() method

The mean() method in Python Pandas is used to return the mean of the values. Let us see an example:

Output

Pandas median() method

The median() method in Python Pandas is used to return the median of the values. Let us see an example:

Output

Pandas std() method

The std() method in Python Pandas is used to return the standard deviation of the values. Let us see an example:

Output

Pandas describe() method

The describe() method in Python Pandas is used to return the summary statistics for each column. Let us see an example:

Output

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Pandas - Group the Data
Categorical Data in Pandas
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading