title: how to group data by positive or negative number in pandas
body: <p>my data set:</p>
  
  <pre><code>*195    -1.888996
  196    -4.402077*
  197     0.171813
  198     2.182845
  199     2.349494
  200     2.239476
  *201    -0.340724
  202    -3.056798
  203    -4.815240
  204    -8.040102
  205    -9.316368
  206    -9.410789
  207    -7.844607
  208    -4.791272
  209    -4.273477
  210    -1.660889
  211    -0.931744
  212    -1.163933
  213    -0.452218*
  214     1.580649
  215     4.331421
  216     6.101737
  </code></pre>
  
  <p>I want to group data like that negative group and positive group alternatively. I tried below.</p>
  
  <pre><code>df['flag']=df.MACD.apply(lambda x:True if x&gt;0 else False)
  df.MACD.groupby(df.flag).sum()
  
  flag
  False   -738.959009
  True     873.042392
  Name: MACD, dtype: float64
  </code></pre>
  
  <p>Only got two groups. But I want to negative group and then positive group and then negative group ... and also every group is independent. </p>