TRA_time_space_diagram icon indicating copy to clipboard operation
TRA_time_space_diagram copied to clipboard

Some runtime errors.

Open M96268004 opened this issue 7 years ago • 2 comments

Hi there, I've tried to use the code, but it will randomly produce some different errors.

root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py
台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725
Traceback (most recent call last):---------------------------] 0.7% ...
  File "batch.py", line 157, in <module>
    main(argv_json_location, argv_website_svg_location, argv_train_no)
  File "batch.py", line 73, in main
    list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站
  File "/root/TRA_time_space_diagram/diagram.py", line 100, in find_stations
    temp.append([stations[station][0], stations[station][1], stations[station][3], km])
KeyError: ''
root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py
台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725
Traceback (most recent call last):---------------------------] 1.5% ...
  File "batch.py", line 157, in <module>
    main(argv_json_location, argv_website_svg_location, argv_train_no)
  File "batch.py", line 73, in main
    list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站
  File "/root/TRA_time_space_diagram/diagram.py", line 100, in find_stations
    temp.append([stations[station][0], stations[station][1], stations[station][3], km])
KeyError: ''
root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py
台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725
201----------------------------------------------------------] 1.2% ...
201----------------------------------------------------------] 1.4% ...
201----------------------------------------------------------] 1.6% ...
Traceback (most recent call last):---------------------------] 4.4% ...
  File "batch.py", line 157, in <module>
    main(argv_json_location, argv_website_svg_location, argv_train_no)
  File "batch.py", line 80, in main
    midnight_km = dg.midnight_train(list_start_end_station, list_passing_stations, over_night_stn) # 跨夜車次處理
  File "/root/TRA_time_space_diagram/diagram.py", line 303, in midnight_train
    item = list_passing_stations[i]
IndexError: list index out of range
root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py
台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725
Traceback (most recent call last):---------------------------] 6.3% ...
  File "batch.py", line 157, in <module>
    main(argv_json_location, argv_website_svg_location, argv_train_no)
  File "batch.py", line 73, in main
    list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站
  File "/root/TRA_time_space_diagram/diagram.py", line 137, in find_stations
    km += float(stations[station][10])
ValueError: could not convert string to float:
root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py
台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725
201----------------------------------------------------------] 1.4% ...
201----------------------------------------------------------] 1.5% ...
201----------------------------------------------------------] 1.6% ...
201----------------------------------------------------------] 1.8% ...
Traceback (most recent call last):---------------------------] 2.7% ...
  File "batch.py", line 157, in <module>
    main(argv_json_location, argv_website_svg_location, argv_train_no)
  File "batch.py", line 73, in main
    list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站
  File "/root/TRA_time_space_diagram/diagram.py", line 194, in find_stations
    km += float(stations[station][15])
ValueError: could not convert string to float:

I've run through the codes but found nothing unusual, can you please advice me if I miss something. thanks.

M96268004 avatar Jul 25 '18 01:07 M96268004

https://github.com/billy1125/TRA_time_space_diagram/tree/master/CSV

這裡面的檔案是否有更新?另外您似乎使用 Linux ,這部分我不清楚是不是可能也是問題來源

M96268004 [email protected] 於 2018年7月25日 週三 上午9:51寫道:

Hi there, I've tried to use the code, but it will randomly produce some different errors.

root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py 台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725 Traceback (most recent call last):---------------------------] 0.7% ... File "batch.py", line 157, in main(argv_json_location, argv_website_svg_location, argv_train_no) File "batch.py", line 73, in main list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站 File "/root/TRA_time_space_diagram/diagram.py", line 100, in find_stations temp.append([stations[station][0], stations[station][1], stations[station][3], km]) KeyError: '' root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py 台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725 Traceback (most recent call last):---------------------------] 1.5% ... File "batch.py", line 157, in main(argv_json_location, argv_website_svg_location, argv_train_no) File "batch.py", line 73, in main list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站 File "/root/TRA_time_space_diagram/diagram.py", line 100, in find_stations temp.append([stations[station][0], stations[station][1], stations[station][3], km]) KeyError: '' root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py 台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725 201----------------------------------------------------------] 1.2% ... 201----------------------------------------------------------] 1.4% ... 201----------------------------------------------------------] 1.6% ... Traceback (most recent call last):---------------------------] 4.4% ... File "batch.py", line 157, in main(argv_json_location, argv_website_svg_location, argv_train_no) File "batch.py", line 80, in main midnight_km = dg.midnight_train(list_start_end_station, list_passing_stations, over_night_stn) # 跨夜車次處理 File "/root/TRA_time_space_diagram/diagram.py", line 303, in midnight_train item = list_passing_stations[i] IndexError: list index out of range root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py 台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725 Traceback (most recent call last):---------------------------] 6.3% ... File "batch.py", line 157, in main(argv_json_location, argv_website_svg_location, argv_train_no) File "batch.py", line 73, in main list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站 File "/root/TRA_time_space_diagram/diagram.py", line 137, in find_stations km += float(stations[station][10]) ValueError: could not convert string to float: root@debian-s-2vcpu-2gb-sgp1-01:~/TRA_time_space_diagram# python3 batch.py 台鐵JSON轉檔運行圖程式 - 版本:1.0b

台鐵JSON時刻表檔案日期:20180725 201----------------------------------------------------------] 1.4% ... 201----------------------------------------------------------] 1.5% ... 201----------------------------------------------------------] 1.6% ... 201----------------------------------------------------------] 1.8% ... Traceback (most recent call last):---------------------------] 2.7% ... File "batch.py", line 157, in main(argv_json_location, argv_website_svg_location, argv_train_no) File "batch.py", line 73, in main list_passing_stations = dg.find_stations(list_start_end_station, train_no['Line'], train_no['LineDir']) # 查詢特定車次所有停靠與通過車站 File "/root/TRA_time_space_diagram/diagram.py", line 194, in find_stations km += float(stations[station][15]) ValueError: could not convert string to float:

I've run through the codes but found nothing unusual, can you please advice me if I miss something. thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/billy1125/TRA_time_space_diagram/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/APuYvr3fMp2aLNwkRNFOVqdPu1AMOxk5ks5uJ88sgaJpZM4VfTXz .

billy1125 avatar Jul 25 '18 02:07 billy1125

該問題已經修正,主因為 Pandas 版本更新問題。

billy1125 avatar Sep 11 '18 06:09 billy1125