首页 > 解决方案 > 按时间序列将单独的数据集合并到一张表中,在仅存在一张表的地方添加新行

问题描述

我正在尝试组合几个不同的数据集以便更容易分析。

它们都显示了具有不同时间戳的不同事物,我想对它们进行分析!

就像,也许在一个时间戳只会弹出一件事作为示例。

数据框看起来像这样,

<bound method NDFrame.to_clipboard of    id                       user_id  sentiment  magnitude     created
0  10  cPL1Fg7BqRXvSFKeU1mJT7KCCTq2       -0.1        0.1  1601820360
1  11  cPL1Fg7BqRXvSFKeU1mJT7KCCTq2       -0.8        0.8  1601820365
2  12  cPL1Fg7BqRXvSFKeU1mJT7KCCTq2       -0.2        0.2  1601900938
3  13  cPL1Fg7BqRXvSFKeU1mJT7KCCTq2       -0.2        0.2  1601900956
4  14  cPL1Fg7BqRXvSFKeU1mJT7KCCTq2        0.2        0.2  1601900971>

<bound method NDFrame.to_clipboard of      angry  disgusted  fearful    happy  neutral      sad  surprised  \
0  0.00620    0.00101  0.00445  0.01214  0.94268  0.03007    0.00345   
1  0.02152    0.00459  0.01222  0.05745  0.85061  0.04810    0.00552   
2  0.01343    0.00362  0.00807  0.04311  0.88810  0.03633    0.00733   
3  0.02397    0.02335  0.00200  0.16026  0.74643  0.04056    0.00344   
4  0.01191    0.00462  0.01357  0.08153  0.88545  0.00083    0.00209   

      created  
0  1603076108  
1  1603076408  
2  1603076708  
3  1603077008  
4  1603077308  >

使用连接,它似乎只在可能存在两个值的地方进行组合。我希望每个都在数据框中。谢谢!

标签: pythonpandas

解决方案


推荐阅读