# credit to the Stack Overflow user in the source link # this is a more general answer pandas.Series.is_monotonic_increasing pandas.Series.is_monotonic_decreasing pandas.Series.is_monotonic