以下示例是关于Python中包含使用列表更改数据框的索引用法的示例代码,想了解使用列表更改数据框的索引的具体用法?使用列表更改数据框的索引怎么用?使用列表更改数据框的索引使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。
#Python 3
#Declare list of index
#and just assign it to the existing dataframe
separate_list = [1,2,3,4,5]
df.index = separate_list
本文地址:https://itbaoku.cn/snippets/872498.html