import json koik=json.load(open("koiksonad.json", encoding="utf-8")) vastus={} for sona in koik: if koik[sona]["kokku"]["frequencyCount"]>=5: vastus[sona]=koik[sona] with open("koiksonad5.json", "w", encoding="utf-8") as f: json.dump(vastus, f)