n = numpy.array([(0, {'lat': 47.8634123, 'lon': 11.9994587, 'id': 0, 'label': u'271382207'}),
(1, {'lat': 47.8599343, 'lon': 11.9930076, 'id': 1, 'label': u'269321789'}),
(2, {'lat': 47.8601615, 'lon': 11.9933169, 'id': 2, 'label': u'269321788'})])
I want to extract all lat,lon tuples as new numpy array. How's that possible?
解决方案
You can do it with a list comprehension:
numpy.array([(e[1]['lat'], e[1]['lon']) for e in n])
This is a basic Python construct that all developers should know about. I suggest you read an introductory book or take a course on Python.