このエラーが発生します:
NameError: name 'getResultFromDatabase' is not defined
これが私のコードです:
import pymongo
from itertools import groupby
from pymongo import Connection
data = getResultFromDatabase()
connection = Connection('localhost', 27017)
db = connection.students
item = db.grades.find({'type' : 'homework'}).sort([('student_id',pymongo.ASCENDING),('score',pymongo.ASCENDING)])
for id, items in groupby(data, lambda s: s['student_id']):
lowest_score = min(i['score'] for i in items)
print lowest_score