import pandas as pdimport pymongoclient = pymongo.MongoClient(‘localhost‘,27017)excel = client[‘CMC‘]sheet1 = excel[‘CMC1‘]import json data = pd.DataFrame(list(sheet1.find())[:])del data[‘-id‘]data.to_excel(io)
时间: 2024-10-12 02:55:34
import pandas as pdimport pymongoclient = pymongo.MongoClient(‘localhost‘,27017)excel = client[‘CMC‘]sheet1 = excel[‘CMC1‘]import json data = pd.DataFrame(list(sheet1.find())[:])del data[‘-id‘]data.to_excel(io)