我在Doctrine中REGEXP
尝试https://stackoverflow.com/a/26195280/1179841找到WHERE CONCAT(",", setcolumn, ",") REGEXP ",(val1|val2|val3),"
这样的条件config.yml
。我在orm:
dql:
string_functions:
regexp: DoctrineExtensions\Query\Mysql\Regexp
"beberlei/DoctrineExtensions": "1.0.*"
但是我仍然收到错误:
[2/2] QueryException:[语法错误]第0行,第790行:错误:预期=,<,< =,<>,>,> =,!=,得到&# 39; REGEXP'
我在composer.json
中使用pd.concat([df, df.products.str.get_dummies().multiply(df["Sales"], axis="index")],
axis=1)
customer products Sales a b c
0 1 a 10 10 0 0
1 1 a 10 10 0 0
2 2 b 20 0 20 0
3 3 c 30 0 0 30
。有什么想法吗?
答案 0 :(得分:1)
您可以像WHERE REGEXP(CONCAT(",", setcolumn, ","), ",(val1|val2|val3),") = 1