标签: comb

为什么在`comb` 中多次使用`<( )>` 标记的行为不符合预期?

我想提取行键(这里是28_2820201112122420516_000000)、列名(这里是bcp_startSoc)和值(这里是64.0$str,其中$str是 HBase 中的一行:

# `match` is OK
my $str = '28_2820201112122420516_000000 column=d:bcp_startSoc, timestamp=1605155065124, value=64.0';
my $match = $str.match(/^ ([\d+]+ % '_') \s 'column=d:' (\w+) ',' \s timestamp '=' \d+ ',' \s 'value=' (<-[=]>+) $/);
my @match-result = $match».Str.Slip;
say @match-result;   # Output: [28_2820201112122420516_000000 bcp_startSoc 64.0]

# `smartmatch` is OK
# $str ~~ /^ ([\d+]+ % '_') \s 'column=d:' (\w+) ',' \s timestamp '=' \d+ ',' \s 'value=' (<-[=]>+) $/
# …
Run Code Online (Sandbox Code Playgroud)

match smartmatch raku comb

9
推荐指数
1
解决办法
114
查看次数

python AttributeError:模块“math”没有属性“comb”

当我尝试使用“comb”功能时出现错误:

$ python
Python 3.7.1 (default, Dec 14 2018, 13:28:58) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> print(math.comb(6,49))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'math' has no attribute 'comb'
>>> 
Run Code Online (Sandbox Code Playgroud)

math python-3.7 comb

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

comb ×2

match ×1

math ×1

python-3.7 ×1

raku ×1

smartmatch ×1