Take the 2-minute tour ×  Have table want to use numpy to slice
into sections  table = ['212:3:0:70.13911:-89.85361:3',
'212:3:1:70.28725:-89.77466:7', '212:3:2:70.39231:-89.74908:9',
'212:3:3:70.48806:-89.6414:11', '212:3:4:70.60366:-89.51539:14',
'212:3:5:70.60366:-89.51539:14', '212:3:6:70.66518:-89.4048:16']
t = np.asarray (table, dtype ='object')  Want to use numpy to
slice all........ 212:3:0, 212:3:1 as k. Want all
'212:3:0:70.13911:-89.85361:3','212:3:1:70.28725:-89.77466:7' as
v  into a dictionany dict (k,v). I dont want to use a for-loop
to do this... I have done this as for loop its slow.  NOTE: the
row has ":", but the ":" does mean the dict ':'.  share|improve
this question add comment  2 Answers  up vote 1 down vote
accepted  Is this what you're after?  dict( (t.rsplit(':',
3)[0], t) for t in table ) ) share|improve this answer add
comment  Basics of dict comprehensions  To convert something
into a dict, you need to make it into an iterable that generates
2-sequences (anything that generates a