输入
15.01.2018;Payment sent;;500.00;;
20.12.2017;Payment received;10.40;;;
Run Code Online (Sandbox Code Playgroud)
预期输出
15.01.2018;Payment sent;-500.00
20.12.2017;Payment received;10.40
Run Code Online (Sandbox Code Playgroud)
电流输出
15.01.2018Payment sent-500.00
20.12.2017Payment received10.40
Run Code Online (Sandbox Code Playgroud)
有人在我的命令中看到了问题吗?
awk 'BEGIN{OFS=";";FS=";"} {print match($4, /[^ ]/) ? $1$2$3"-"$4 : $1$2$3}' < in.csv > out.csv
Run Code Online (Sandbox Code Playgroud)
谢谢
如何将 /posts 作为主页?
我应该重定向、更改hugo 1配置中的baseURL还是在主题2配置中进行更改?
1 https://gohugo.io/getting-started/configuration/
2 https://github.com/luizdepra/hugo-coder/wiki/Configurations
我收到指向runtime=_lambda..变量的 Flycheck 错误:
Argument of type "(cls: Runtime) -> Runtime" cannot be assigned to parameter "runtime" of type "Runtime" in function "__init__" \xc2\xa0\xc2\xa0Type "(cls: Runtime) -> Runtime" cannot be assigned to type "Runtime"
# create lambda function\n# executed as root\nfunction = _lambda.Function(self,\n "lambda_function",\n runtime=_lambda.Runtime.PYTHON_3_7,\n handler="lambda_handler.main",\n code=_lambda.Code.from_asset("./lambda"),\n environment={\n \'EC2_INSTANCE_ID\':\n instance.instance_id,\n \'S3_OUTPUT\':\n output_s3.s3_url_for_object(),\n \'S3_INPUT\':\n input_s3.s3_url_for_object()\n })\n\nRun Code Online (Sandbox Code Playgroud)\n这是一个相当表面的 IDE 问题,代码本身可以工作
\n我试图理解atof方法,但是,下面的块失败,主题标题中出现错误:
import locale
s='2,5'
x=locale.atof(s)
Run Code Online (Sandbox Code Playgroud)
我能做些什么?
我的直觉告诉我reduce(from functools import reduce)会提供我正在寻找的东西,但我无法在这里使用它。
def test_reduce_lists_by_summing_them():
"""
Sum each item from the first list with the same positional item from the subsequent list.
The result is the next first list and appended to the returned result list.
"""
input_ = [[1, 0, 0], [0, 1, 0], [0, 0, 2], [3, 0, 0]]
expected_output = [[1, 1, 0], [1, 1, 2], [4, 1, 2]]
def f(x, y):
"""Return the sum of two positional items"""
return x + y
output …Run Code Online (Sandbox Code Playgroud) 我该怎么做才能使这个工作?
我不是perl专家,因此除了工具安装手册指示我运行此行之外,我不能再提供任何细节了:
cd ~
cpanm --sudo --installdeps .
Run Code Online (Sandbox Code Playgroud)
返回
--> Working on .
Configuring /home/user ... N/A
! Configuring . failed. See /home/user/.cpanm/work/1532680018.20391/build.log for details.
Run Code Online (Sandbox Code Playgroud)
日志
cat /home/user/.cpanm/work/1532680018.20391/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.026002 built for x86_64-linux-thread-multi
Work directory is /home/user/.cpanm/work/1532680018.20391
You have make /usr/bin/make
You have LWP 6.33
You have /usr/bin/tar: tar (GNU tar) 1.30
You have /usr/bin/unzip
--> Working on .
Entering /home/user
Configuring /home/user
-> N/A
! Configuring . failed. See /home/user/.cpanm/work/1532680018.20391/build.log for details.
Run Code Online (Sandbox Code Playgroud)