我想写我自己的
在开始任何实现之前,我只想从OpenRefine构建OpenRefine,只是为了让我开始。
但是,我得到了Maven错误
Could not resolve dependencies for project org.openrefine:sample:jar:3.0-SNAPSHOT: org.openrefine:main:jar:3.0-SNAPSHOT was not found in https://oss.sonatype.org/content/repositories/snapshots/ during a previous attempt. This fai
我使用的是在Windows上运行的Openrefine (openrefine-2.6-rc.2),使用Chrome浏览器(65.033225.181 )打开
我有文本格式(.txt)的数据,我已经导入到Openrefine中进行清理和处理。数据条目驻留在一列下的行中。我想要“转置”(透视)行中的项目,使它们出现在列中
以下是当前状态的示例:
Column 1
Mary Smith
Company Name IBM
Location New York
John Davis
Company Name Lockheed-Martin
Location Los Angeles
Jane Seg
我有下面的用例,OpenRefine似乎是一个很好的解决方案。我的数据库中有一个现有的“脏”产品表,如下所示:
id name
51 Product A
52 product-a
53 product B
54 productb
55 produtc
56 productc
我有一个新的,“干净”的产品表,如下所示:
id name
1 Product A
2 Product B
3 Product C
我想使用OpenRefine的集群生成一个映射文件,以帮助我将产品从旧表映射到新表:
id name old_id
1 Product A
我有一张table_a表,就像这样 query
------
apple
no fruit
this is
not a number 我想编写hive查询来获得基于空间的字数,比如 query count
------ ------------
apple 1
no fruit 2
this is 2
not a number 3
在一列中,我有这样的varchars。
Home External +1 PD
Home +24 PD
Home +1 PD
Home Set 1 PD
Home External +12 PD
Home 1 PD
Home External +2 PD
Home Set +1 PD
Home External +24 PD
Home Set PD
我试着用这种方式对它们进行排序:
(按字母和数字顺序)
Home 1 PD
Home +1 PD
Home +24 PD
Home External +1 PD
Home External
我有一个文本列表,假设从A1到A{n},如下所示:
Alternative
Ambient
Rock
Metal
ecc..
然后,我在每个单元格中得到一个文本列表,除以";“
例如,在第一个单元格中
Alternative; Rock; Pop
我为{n}列提供了这样的列表,假设从C1到C{n}。
我需要做的是计算每一列的每个列表中每个文本(从A1到A{n})出现的次数。
例如,假设我有两列:
Alternative; Rock; Pop
Ambient; Rock; Metal
我需要知道的是,Alternative只存在一次,Rock只有两次,然后从B1到B{n}。
所以我所期待
我希望将所有包含括号的城市名称字符串替换为括号中包含的内容,但我这样做是错误的。请指教
df$City<-ifelse(grep("[(]",df$City),gsub(".*\\((.*)\\).*", "\\1", df$City),df$City)
Warning message:
In `[<-.data.table`(x, j = name, value = value) :
Supplied 53 items to be assigned to 9243 items of column 'City' (
这是我的第一个问题!
怎样的模式才能成为最后的"!“在此拆分列表中显示为项吗?
import re
re.split(r'([.?!]) ', 'One sentence. Another one? And the last one!')
我得到:如果我使用['One sentence', '.', 'Another one', '?', 'And the last one!'],或者['One sentence', '.',
下面列表中的每个字符串对应两个标签:
tags = ['Club House Folk Pop ', 'alternative rock electro ']
我想拆分字符串,以便创建具有正确分类类型的子列表,如下所示:
['Club house', 'Folk Pop']和['alternative rock', 'electro']
我知道我可以将列表分成以下几部分:
for t in tags:
tag = t.split("")
但这会破坏标签的含义。
有没有一种方法