title: divide group data base on select columns values?
body: <p><strong>df</strong></p>
  <pre><code>   ts_code    type  close
  
    0 861001.TI   1   648.399
    1 861001.TI   20  588.574
    2 861001.TI   30  621.926
    3 861001.TI   60  760.623
    4 861001.TI   90  682.313
    ...   ... ... ...
    8328  885933.TI   5   1083.141
    8329  885934.TI   1   951.493
    8330  885934.TI   5   1011.346
    8331  885935.TI   1   1086.558
    8332  885935.TI   5   1028.449
  </code></pre>
  <p><strong>Goal</strong></p>
  <pre><code>ts_code    l5d_close l20d_close …… l90d_close
  861001.TI   NaN       1.10          0.95
  ……           ……       ……            ……
  </code></pre>
  <p>I want to groupby <code>ts_code</code> to calculate the <code>close</code> of <code>type(1)</code>/the <code>close</code> of <code>type(N:5,20,30……)</code>. Take <code>861001.TI</code> for example, <code>l5d_close</code> is nan because there is no value when the type is 5. <code>l20d_close</code> equals 648.399/588.574=1.10, <code>l90d_close</code> equals 648.399/682.313=0.95. And the result is rounded.</p>
  <p>Try</p>
  <pre><code>df.groupby('ts_code')\
    .pipe(lambda x: x[x.type==1].close/x[x.type==10].close)
  
  Got: KeyError: 'Column not found: False'
  </code></pre>
  <p>The type values is: 1,5,20,30,60,90,180,200</p>
  <p>Notice: There is one value of <code>type</code> columns for each <code>ts_code</code></p>