enter image description here我有一个mongodb连接(发布在图片中),它有一个大约20个文件的集合。 我想从python读取/加载每个集合并进行必要的计算。你知道吗
请在下面找到我想做的样品。你知道吗
import pandas as pd
import json
from pandas.io.json import json_normalize
from unittest.mock import inplace
from pymongo import MongoClient
connection = MongoClient('localhost', 27017)
db=connection.Tmobile
collection=db.collection_names(include_system_collections=False)
for collect1 in collection:
print(collect1)
with open(collect1,'r') as fi:
d=json.load(fi)
print(d)
当我尝试这个它给我下面的错误。你知道吗
我的新 回溯(最近一次呼叫): 文件“C:\Users\esrilka\eclipse workspace\My First PyDev Project\数据库示例.py,第12行,在 打开(collect1,'r')作为fi: FileNotFoundError:[Errno 2]没有这样的文件或目录:“Mynew”
目前没有回答
相关问题 更多 >
编程相关推荐