pandas的split函数
时间: 2023-10-01 14:08:45 浏览: 102
一个Split函数用法
5星 · 资源好评率100%
pandas的split函数是DataFrame和Series对象的一个方法,用于将字符串按照指定的分隔符进行分割。它的语法是:str.split(pat=None, n=-1, expand=False)。其中,pat是字符串分隔符,默认为空格;n用于指定需要分割的次数,默认为-1,表示返回所有分割的字符串;expand则是用于控制是否将拆分的字符串展开为单独的列,默认为False,如果设置为True,则会将分割后的字符串展开为多列的DataFrame。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Pandas数据分析 - 分列 - split() 用法](https://blog.csdn.net/m0_65392155/article/details/122504432)[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_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [pandas字符串分割str.split()函数](https://blog.csdn.net/hanyunkaka/article/details/120586261)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文