1 回答

TA貢獻(xiàn)2041條經(jīng)驗 獲得超4個贊
讓我們使用從列中extractall
提取lat
,long
和,然后對其進(jìn)行重塑,最后使用列和:alt
Coordinates
unstack
join
ID
Region
c = df['Coordinates'].str.extractall(r'([\d.]+)')[0].unstack()
d = df[['ID', 'Region']].join(c.set_axis(['lat', 'long', 'alt'], 1))
? ?ID? Region? ? ? ? ? ? ? ? lat? ? ? ? ? ? ? ? long? ? ? ? ? ? ? ? ?alt
0? ?1? Europe? 52.00755721100514? 12.565129548994266? 185.23616827199143
1? ?2? Europe? 52.00755721100514? 12.565129548994266? 185.23616827199143
2? ?3? Europe? 52.00755721100514? 12.565129548994266? 185.23616827199143
3? ?4? Europe? 52.00755721100514? 12.565129548994266? 185.23616827199143
4? ?5? Europe? 52.00755721100514? 12.565129548994266? 185.23616827199143
添加回答
舉報