我特林做:如何使用pandas read_json讀取ADSB json數據?
import pandas as pd
df = pd.read_json('2016-06-20-2359Z.json')
而且我採取這一錯誤:
ValueError: Trailing data
這裏是JSON文件的短版:
{"src":1,"feeds":[{"id":1,"name":"ADSBexchange.com","polarPlot":false}],"srcFeed":1,"showSil":true,"showFlg":true,"showPic":true,"flgH":20,"flgW":85,"acList":[{"Id":11281748,"Rcvr":1,"HasSig":false,"Icao":"AC2554","Bad":false,"Reg":"N882AS","FSeen":"\/Date(1466467166951)\/","TSecs":3,"CMsgs":1,"AltT":0,"Tisb":false,"TrkH":false,"Type":"CRJ2","Mdl":"2001 BOMBARDIER INC CL-600-2B19","Man":"Bombardier","CNum":"7503","Op":"EXPRESSJET AIRLINES INC - ATLANTA, GA","OpIcao":"ASQ","Sqk":"","VsiT":0,"WTC":2,"Species":1,"Engines":"2","EngType":3,"EngMount":1,"Mil":false,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"Gnd":false,"SpdTyp":0,"CallSus":false,"TT":"a","Trt":1,"Year":"2001"},{"Id":11402205,"Rcvr":1,"HasSig":true,"Sig":110,"Icao":"ADFBDD","Bad":false,"FSeen":"\/Date(1466391940977)\/","TSecs":75229,"CMsgs":35445,"Alt":8025,"GAlt":8025,"AltT":0,"Call":"TEST1234","Tisb":false,"TrkH":false,"Sqk":"0262","Help":false,"VsiT":0,"WTC":0,"Species":0,"EngType":0,"EngMount":0,"Mil":true,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"Gnd":true,"SpdTyp":0,"CallSus":false,"TT":"a","Trt":1}],"totalAc":4231,"lastDv":"636019887431643594","shtTrlSec":61,"stm":1466467170029}
有任何人都可以看到爲什麼?
這是JSON文件的行? json文件是否包含多行這樣的行? – Alperen
是的,它是json文件的一行。它只是在行內有許多{「Id」:11281748,「Rcvr」:1,「HasSig」:假,「Icao」:「AC2554」,「Bad」:假,「Reg」:「N882AS」 FSeen 「:」/日期(1466467166951)/」, 「TSecs」:3 「CMsgs」:1, 「AltT」:0 「TISB」:假 「TrkH」:假, 「類型」: 「CRJ2」, 「Mdl」:「2001 BOMBARDIER INC CL-600-2B19」,「Man」:「龐巴迪」,「CNum」:「7503」,「Op」:「ATLANTA,GA」,「OpIcao」:「ASQ」 SQK 「:」」, 「VSIT」:0 「WTC」:2 「種類」:1, 「引擎」: 「2」, 「EngType」:3 「EngMount」:1, 「軍用」:假, 「Cou」:「美國」,「HasPic」:false,「有興趣」:false,「FlightsCount」爲0,「Gnd」爲false,「SpdTyp」爲0,CallSus爲false,TT爲「如果我刪除{「src」:1,「feeds」:[{「id」:1,「name」:「ADSBexchange.com」),那麼您可以使用「Trt」:1,「Year」:「2001」}, – user8149657
。 ,「polarPlot」:false}],「srcFeed」:1,「showSil」:true,「showFlg」:true,「showPic」:true,「flgH」:20,「flgW」:85,「acList」開始和結束,「totalAc」:4231,「lastDv」:「636019887431643594」,「shtTrlSec」:61,「stm」:1466467170029} 它會工作發現。但是我想獲得一個讀取原始文件的方法,因爲有太多這樣的文件,我不能親自去做。 – user8149657