基本信息
文件名称:数据分析与可视化 课件 2.1.5切片和索引.pptx
文件大小:2.18 MB
总页数:9 页
更新时间:2025-07-22
总字数:约1.49千字
文档摘要

切片和索引

1.切片numpy.slice函数切片操作(1)numpy.slice(start,stop,step)start:起始下标;stop:终止下标;step:步长。参数值:整数。(2)numpy.slice(start,stop)两个参数时,代表start、stop,步长默认为1。(3)numpy.slice(stop)仅有一个参数代表stop:终止下标。

2.索引(1)一维数组索引①[index]index为非负整数时,从0往后数;index为负整数时,从-1往前数。②[start:stop]取值范围:[start:stop)。③[start:]、[: