如何在python中同步数据帧?

时间:2018-06-04 07:08:17

标签: python python-3.x pivot-table pandas-groupby

我有两个数据框

  0 Product     Range(Days)    Sold
  1   A          1-3            5
  2              4-7            23
  3              8-15           2
  4   B          4-7            4
  5              8-15           1
  6   C          1-3            5
  7   D          1-3            2
  8   E          1-3            9

0 Product     Repair_Calls
1    A            2 
2    C            45
3    D            32
4    E            1

是否可以合并为一个维修电话与产品相同,而不是0-4

  0 Product     Range(Days)    Sold     Repair_Calls
  1   A          1-3            5           2
  2              4-7            23
  3              8-15           2
  4   B          4-7            4           0
  5              8-15           1
  6   C          1-3            5           45
  7   D          1-3            2           32
  8   E          1-3            9            1

1 个答案:

答案 0 :(得分:1)

this.setState({scale: 'c', temperature: temperature});

Reference