比如读取数据时想把第一列设为index,那么只需要简单的

 

pd.read_csv("new_wordvecter.csv",index_col=[0]) 

 

 这里index_col可以设为列名

后续更改index可以使用df.index = df.iloc[:,"column"].tolist()或df.set_index('column')

 

 

 

 

相关文章:

  • 2022-12-23
  • 1970-01-01
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2021-04-17
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2021-06-18
  • 2022-12-23
  • 2021-08-13
  • 2021-05-24
  • 2022-12-23
  • 2021-03-26
  • 2022-12-23
相关资源
相似解决方案