如何在dolphindb python api中pivot一个表?

在python中,有如下的dataframe:

  time                 A    B    C      D  E  F
0 2019-12-19 15:00:00  foo  one  small  1  2  2
1 2019-12-19 15:00:30  foo  one  large  2  4  4
2 2019-12-19 15:01:00  foo  one  large  2  5  5
3 2019-12-19 15:01:30  foo  two  small  3  5  5
4 2019-12-19 15:02:00  foo  two  small  3  6  6
5 2019-12-19 15:02:30  bar  one  large  4  6  6
6 2019-12-19 15:03:00  bar  one  small  5  8  8
7 2019-12-19 15:03:30  bar  two  small  6  9  9
8 2019-12-19 15:04:00  bar  two  large  7  9  9

怎么通过dolphindb python orca api把上述dataframe转化成如下dataframe?其中的数字代表每种AE组合D的数量和。

E    2    4    5     6  8    9
A                               
bar  NaN  NaN  NaN   4  5.0  13.0
foo  1.0  2.0  5.0   3  NaN   NaN
阅读 804
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进