python 按列拆分表
时间: 2023-09-01 09:10:07 浏览: 116
你可以使用Python中的pandas库来按列拆分表。下面是一个示例代码:
```
import pandas as pd
# 读取Excel文件
df = pd.read_excel('文件路径/文件名.xlsx')
# 按照指定列进行拆分
data_list = list(df.groupby(['列名']))
# 遍历拆分后的数据
for data in data_list:
# 生成拆分后的表格
data<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [用Python将excel表格按照列拆分为多个表格](https://blog.csdn.net/olegja3d/article/details/128790517)[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* [python打包EXE对Excel文件进行某列拆分](https://download.csdn.net/download/weixin_42636075/87684950)[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 ]
阅读全文