pandas groupby index不为空
时间: 2023-10-22 19:09:57 浏览: 97
在pandas的groupby函数中,当参数as_index被设置为True时,表示分组的结果中会将分组的键作为索引,默认值为True。所以,当你使用groupby函数时,并且希望结果中的索引不为空,你可以将as_index参数设置为False。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [pandas groupby 使用指南](https://blog.csdn.net/weixin_35020262/article/details/113004831)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Pandas之groupby( )用法笔记小结](https://download.csdn.net/download/weixin_38570854/14866486)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文