Calculating Series Statistics Part 1

This thread is part 1 of 2 which will be focused on calculating different statistical values of a series using different alternative methods for each statistic. Firstly, if you are unfamiliar with series objects or you want to learn more about them, have a look at the following threads:

The following statistical calculations of a series will be covered in this thread:

  1. Minimum Value
  2. Maximum Value

However, if you want to learn more series statistics, then have a look at the second part of this thread: Calculating series statistics part 2.

The minimum value

1. Using 'min()' method:

  • The min() method of a Pandas series returns the minimum value in the series.

2. Using 'nsmallest()' method:

  • The nsmallest() method returns the smallest n values in the series. To find the first minimum value, we can use n=1 .

3. Using 'idxmin()' method:

  • The idxmin() method returns the index of the minimum value in the series.

4. Using 'np.min()' method:

  • The np.min() is a NumPy function that is used to find the minimum value from a collection of values.

The maximum value

1. Using 'max()' method:

  • The max() method of a Pandas series returns the maximum value in the series.

2. Using 'nlargest()' method:

  • The nlargest() method returns the largest n values in the series. To find the first maximum value, we can use n=1 .

3. Using 'idxmax()' method:

  • The idxmax() method returns the index of the maximum value in the series.

4. Using 'np.max()' method:

  • The np.max() is a NumPy function that is used to find the maximum value from a collection of values.