dataframe列名
时间: 2023-09-21 22:09:59 浏览: 95
修改dataframe列名有两种方式。第一种方式是使用df.columns属性,将要修改的列名以列表的形式赋值给df.columns。例如,如果要将列名"A"修改为"a",将列名"B"修改为"b",可以使用df.columns = ['a', 'b']的方法。这种方式会直接修改dataframe的列名。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Dataframe修改列名](https://blog.csdn.net/Unravel_36/article/details/123873694)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [pandas dataframe获取列名、添加列名、列索引](https://blog.csdn.net/pearl8899/article/details/127554276)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文