python - Is a column in pandas.DF() monotonically increasing? -


I can check whether the index of pandals. Dataframe () is increasing monotonically by using the is_monotonic method. However, I would like to check whether the value of one column (float / integer) is increasing steadily in the column value? [13]: my_df = pd.DataFrame ([1,2, 3,5,7,6,9]) in [14]: my_df out [14]: 0 1

  1 2 2 3 3 5 4 7 5 6 6 9: my_df.index.is_monotonic Out [15]: The truth is that getting the datafile column as an oval array is the best way to copy data Without a (after selection of columns through indexing), and then using a sample-based test to check a nonontoncity:  
  def monotonic (x): return np.all (Np.diff (x)> monotonic (df [0] .values)  

pure Python car Implementation, borrowed from:

  def strictly mounting (L): zip (L, L [1:]) in all x (for x and lt; y)  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -