慕丝7291255
使用iloc与::-1用于列交换顺序:dfgeo = pd.DataFrame({'geo': ['1,2,3,4', '1,2,3,4,5,6,7']})print (dfgeo) geo0 1,2,3,41 1,2,3,4,5,6,7df = dfgeo['geo'].str.split(',',expand=True).iloc[:, ::-1]#if necessary set default columns namesdf.columns = np.arange(len(df.columns))print (df) 0 1 2 3 4 5 60 None None None 4 3 2 11 7 6 5 4 3 2 1