我有一个给定的数据框(名称为df1),其中包含以下记录:
ID MONTH Balance
10034 April 18995.00
February 18726.00
March 1098.00
10093 January 38000.00
10026 April 24.00
10047 April 6000.00
February 10000.00
March 68023.47
May 5000.00
100447 April 14228.00
May 106595.00
我正在使用以下代码将此数据帧存储在mongodb中:
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.Data
records = json.loads(df1.T.to_json()).values()
db.Inflow_Balance.insert(records)
当我执行时,我收到错误消息:
ValueError: Expecting : delimiter: line 1 column 5 (char 4)
我能知道如何解决此错误吗