I am attempting to create an origin destination matrix in python for all of the London Underground Stations. I have the station name and the lat, lng of its location. It is in the following csv format
Station Lat LngAbbey Road 51.53195199 0.003737786Abbey Wood 51.49078408 0.120286371Acton 51.51688696 -0.267675543I wish to turn this list of stations into a matrix of all possible combinations of these stations. So, for the example above, I would like to achive:
O_Station O_Lat O_Lng D_Station D_Lat D_LngAbbey Road 51.53195199 0.003737786 Abbey Road 51.53195199 0.003737786Abbey Road 51.53195199 0.003737786 Abbey Wood 51.49078408 0.120286371Abbey Road 51.53195199 0.003737786 Acton 51.51688696 -0.267675543Abbey Wood 51.49078408 0.120286371 Abbey Road 51.53195199 0.003737786Abbey Wood 51.49078408 0.120286371 Abbey Wood 51.49078408 0.120286371Abbey Wood 51.49078408 0.120286371 Acton 51.51688696 -0.267675543Acton 51.51688696 -0.267675543 Abbey Road 51.53195199 0.003737786Acton 51.51688696 -0.267675543 Abbey Wood 51.49078408 0.120286371Acton 51.51688696 -0.267675543 Acton 51.51688696 -0.267675543Obviously, at this point I will need to cancel out the 0-0 combinations.
أكثر...
Station Lat LngAbbey Road 51.53195199 0.003737786Abbey Wood 51.49078408 0.120286371Acton 51.51688696 -0.267675543I wish to turn this list of stations into a matrix of all possible combinations of these stations. So, for the example above, I would like to achive:
O_Station O_Lat O_Lng D_Station D_Lat D_LngAbbey Road 51.53195199 0.003737786 Abbey Road 51.53195199 0.003737786Abbey Road 51.53195199 0.003737786 Abbey Wood 51.49078408 0.120286371Abbey Road 51.53195199 0.003737786 Acton 51.51688696 -0.267675543Abbey Wood 51.49078408 0.120286371 Abbey Road 51.53195199 0.003737786Abbey Wood 51.49078408 0.120286371 Abbey Wood 51.49078408 0.120286371Abbey Wood 51.49078408 0.120286371 Acton 51.51688696 -0.267675543Acton 51.51688696 -0.267675543 Abbey Road 51.53195199 0.003737786Acton 51.51688696 -0.267675543 Abbey Wood 51.49078408 0.120286371Acton 51.51688696 -0.267675543 Acton 51.51688696 -0.267675543Obviously, at this point I will need to cancel out the 0-0 combinations.
أكثر...