}) with open("C:/Users/kibaa/dino/dino/rec_stop.din", 'r') as stopfile: rec_stop = pandas.read_csv(stopfile, skipinitialspace=True, sep=';', dtype={ 'VERSION': int, 'STOP_NR': int, 'STOP_TYPE_NR': int, 'STOP_NAME': str, 'STOP_SHORTNAME': str, 'STOP_POS_X': str, 'STOP_POS_Y': str, 'PLACE': str, 'OCC': int, 'IFOPT': str }, index_col=1) stops = readallstops(version, rec_stop, rec_stop_area, rec_stopping_points) dstops = {stop.ifopt: stop.name for stop in stops.values()} pprint(dstops) for ifopt in r: r[ifopt]["name"] = dstops.get(ifopt) if not dstops.get(ifopt): print("warning", ifopt) pprint(r)
sep=';', dtype={ 'VERSION': int, 'LINE_NR': int, 'STR_LINE_VAR': int, 'LINE_DIR_NR': int, 'LINE_NAME': str }, index_col=3) # dates = [(2018, 11, 5), (2018, 11, 6), (2018, 11, 7), (2018, 11, 8), (2018, 11, 9), (2018, 11, 10), (2018, 11, 11)] dates = [(2018, 11, 8)] versionidVER = 21 versionidHST = 10 versionVER = Version(set_version.loc[versionidVER]) stopsVER = readallstops(versionVER, rec_stop, rec_stop_area, rec_stopping_points) versionHST = Version(set_version.loc[versionidHST]) stopsHST = readallstops(versionHST, rec_stop, rec_stop_area, rec_stopping_points) restrictions = { versionidVER: readrestrictions(service_restriction, versionVER), versionidHST: readrestrictions(service_restriction, versionHST) } lines = { 45511: Line(versionVER, 45511, rec_lin_ber, lid_course, lid_travel_time_type, stopsVER), 50510: Line(versionHST, 50510, rec_lin_ber, lid_course, lid_travel_time_type, stopsHST)