Question: Find the top 3 road segments for each route in terms of ARP from df. Store the results in x. Include only four columns in
Find the top 3 road segments for each route in terms of ARP from df. Store the results in x.
Include only four columns in x.
SegID, RouteNo, ARP, [rank of that road segment in its route]
Hint: use duckdb
SegID Route No BegMP AccCount 5 190.61 5 166.75 5 172.58 5 133.06 90 51.74 526 405 531 405 167 3319 3322 3112 3115 3174 3177 2810 2813 4386 4389 1366 1367 2302 2305 1617 1620 2305 2308 2456 2459 4.45 3.77 6.63 4.01 25.75 SPF EB_SAFE 224 44.175417 220.331946 176.156529 196 18.312077 187.501295 169.189218 149 20.361963 143.439954 123.077990 126 30.472581 123.200885 92.728304 108 11.968350 101.146069 89.177719 116 2.901712 88.777208 85.875496 105 20.410361 101.352127 80.941766 97 7.612699 87.363604 79.750905 96 12.836401 90.439027 77.602626 100 20.771058 75.869062 ARP 96.640120
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
