title: Create a list by the index of the column values meet the condition python
body: <p>I have a dataframe with two columns ['A', 'B']. The columns are sorted already. I want to find a list of A values based on every first n times of 100 of column B and add min and max in the list. And n is fixed with 3 times.</p>
  <blockquote>
  <p>d={'A': [15,16, 17,19,20,21,25,26,27,28,29,30], 'B':
  [25,90,101,137,140,190,202,207,290,304,355,367]</p>
  </blockquote>
  <blockquote>
  <p>df=pd.DataFrame(data=d)</p>
  </blockquote>
  <p>The end result is to create a list=[15,17,25,28,30] based on another list of B values:[25, 101,202,304,367].</p>
  <p>I previously set colA=[min(df.A)], and I'm trying to append the other three items based on the index of the colB list. And add the max column A value as the last item in the list colA.</p>
  <p>So back to the other 3 items in colB, I'll need to do in the range(3) iteration. So when n=0, the first item is the first value that closed to (n+1)*100 but &gt;(n+1)*100, same thing for the rest two values.</p>