我是mongodb的新手.在Windows中安装mongodb后,我尝试使用以下命令插入一个简单的json文件:
C:\>mongodb\bin\mongoimport --db test --collection docs < example2.json
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
connected to: 127.0.0.1
Fri Oct 18 09:05:43.749 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Field name expected: offset:43
Fri Oct 18 09:05:43.750
Fri Oct 18 09:05:43.750 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Expecting '{': offset:0
Fri Oct 18 09:05:43.751
Fri Oct 18 09:05:43.751 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Field name expected: offset:42
Fri Oct 18 09:05:43.751 …Run Code Online (Sandbox Code Playgroud) 我有一个包含两列的数据框,如下所示:
Col1 Col2
1 7197.36 14.00
2 NA 5173.94
3 NA 13333.06
4 7004.38 473.32
5 NA 4980.61
6 26355.52 110.05
7 NA 1307.32
8 NA 6531.06
9 NA 3777.65
10 NA 7827.44
11 8753.22 85.00
12 NA 1.86
13 NA 2009.42
14 NA 502.89
15 NA 3182.86
16 NA NA
Run Code Online (Sandbox Code Playgroud)
我想在"Col2"列中找到与"Col1"中的单个值对应的匹配行.例如,7197.36 = 14.00 + 5173.94 + 2009.42('Col2'中的第1,2,13行)
这里,'Col1'的总和='Col2'的总和
最终数据框应如下所示:
Col1 Col2
1 7197.36 14.00
2 NA 5173.94
3 NA 2009.42
4 7004.38 473.32
5 NA 6531.06
6 26355.52 110.05 …Run Code Online (Sandbox Code Playgroud)