如何在OpenRefine中合并行 [英] How to merge rows in OpenRefine

查看:281
本文介绍了如何在OpenRefine中合并行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据某些ID字段合并行?

How to merge rows based on some ID field?

Original Table                   New Table

ID   | Field1 | Field2       ID     | Field1 | Field2
-----|------- |--------      -------|--------|-------
A        5                    A         5        10
A                10           B         1        3
B        1                    C         4        150
B                3
C        4
C                150

我想基于某个ID字段标识的组中的值来填充给定的单元格值.

I want to fill a given cell value based on value in a group identified by some ID field.

也就是说,我要聚合表,并在每列中使用非空值作为聚合函数.

That is, I want to aggregate table and use non empty value in each column as aggregation function.

推荐答案

在ID列中,使用菜单选项:Edit Cells-> Blank down 这应该给您留下一个看起来像这样的表:

In the ID column use the menu option: Edit Cells -> Blank down This should leave you with a table looking like:

ID   | Field1 | Field2 
-----|------- |--------
A        5             
                 10    
B        1             
                 3
C        4
                 150

确保您处于记录"模式(此选项位于数据网格的左上方).您应该看到每个ID的行都分组在一起.

Make sure you are in "Records" mode (this option is at the top left of the data grid). You should see the rows for each ID are grouped together.

现在使用编辑单元格"->在其他各列上连接多值单元格-对所有列完成此操作后,每条记录将只留下一行

Now use Edit Cells -> Join multi-valued cells on each of the other columns - this should leave you with a single row per record once you have done this for all columns

这篇关于如何在OpenRefine中合并行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆