Python/pyspark data frame rearrange columns

前端 未结 2 1952
囚心锁ツ
囚心锁ツ 2020-12-05 10:10

I have a data frame in python/pyspark with columns id time city zip and so on......

Now I added a new column

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 10:34

    You can use select to change the order of the columns:

    df.select("id","name","time","city")
    

提交回复
热议问题