Aug-27-2018, 06:09 AM
Hello,
Searching the archives with "two dimensional array last" returned no hits.
I need to find the last tuple from this kind of output:
Searching the archives with "two dimensional array last" returned no hits.
I need to find the last tuple from this kind of output:
[[2.3110949921647266, 48.81514649393979], [2.3113524842301563, 48.815923619981966], …[2.28392243385315, 48.84728589885864], [2.2819232977235515, 48.84809311844251]]Is there a better way than this?
first = track['geometry']['coordinates'][0] #BAD last = track['geometry']['coordinates'][-1] #BAD last = track['geometry']['coordinates'].keys()[-1] #BAD last = track['geometry']['coordinates'].count() sizearray = len(track['geometry']['coordinates']) print(track['geometry']['coordinates'][sizearray-1])Thank you.