frog/preprocess.py

8 lines
258 B
Python
Raw Permalink Normal View History

2024-08-21 00:10:50 +02:00
import json
with open("raw.json", "r") as f:
string = f.read()
rawls = json.loads(string)
latlons = [{'lat': x['lat'], 'lon': x['lon']} for x in rawls if x['lon'] != None]
with open("pos.json", "w") as w:
w.write(json.dumps(latlons))