如何在 JavaScript 中执行以下操作?我想从 url“ https://data.cityofnewyork.us/resource/734v-jeq5.json ”加载 JSON 数据。然后,获取仅包含“sat_critical_reading_avg_score”数组的 JSON 数据。非常感谢任何帮助。import jsonimport urllib.requestdef get_data(): response = urllib.request.urlopen("https://data.cityofnewyork.us/resource/734v-jeq5.json") content = response.read().decode() response1 = json.loads(content) result = [] for i in response1: try: result.append( int(i['sat_critical_reading_avg_score']) ) except: pass return resultprint(get_data())
添加回答
举报
0/150
提交
取消