python str.split和numpy.split函数
2015-10-18 13:36
796 查看
参考:
《Machine Learning In Action》
############################################################
str.split函数:
##################################################
numpy.split函数:
可用于分割数组
《Machine Learning In Action》
############################################################
str.split函数:
help(str.split)
a="as df g" a.split() #没有参数时默认分割空格
a="as df g" a.split(" ", 1) #也可指定分割次数
##################################################
numpy.split函数:
from numpy import * help(split)
可用于分割数组
from numpy import * x=array(range(9)) split(x, 3) split(x, [2,5,6])
相关文章推荐
- 【Python】三种遍历文件目录的方法
- Python 基础
- python中threading的常用方法的详解
- python第一次练习题
- python中汉字匹配
- Python beautifulsoup的安装与使用
- 【Python】Learn Python the hard way, ex47 自动化测试,环境变量设置
- python 函数 enumerate
- 初学python案例 字典
- Python IDLE 代码高亮主题
- 用R&Python在云端运行可扩展数据科学
- python实现简单爬虫功能
- python_12(查找字符串、字符串查找、时间转换、正则、限定符、分组)
- python_11(format、转义字符、连接字符、字符串操作函数、字符串反转)
- python初级教程:入门详解
- Python学习
- Python 配置日志
- 在arcgis使用python脚本进行字段计算时是如何解决中文问题的
- python学习笔记之调用eval函数出现invalid syntax错误问题
- python_10(内置模块)