简介 目录 评价 推荐
  • 慕仙7164959 2024-11-29

    一、一维数组的索引访问

    一维数组索引访问与Python内置序列类型索引访问一样

    https://img1.sycdn.imooc.com/67499c9d0001ba8805760295.jpg

    二、二维数组索引访问

    https://img1.sycdn.imooc.com/67499d410001d50008510495.jpg 

    代码联系:

    import numpy as np

    # %% 一维数组的索引访问  

    a = np.array([1, 2, 3, 4, 5])

    print(a[4], a[-1])


    # %% 二维数组的索引访问

    b = np.array([[1, 3, 5, 7],

                  [2, 4, 6, 8],

                  [7, 8, 9, 10]])

    print(b[2][3],b[2,3],b[-1,-1])

    0赞 · 1采集
  • 慕圣4021330 2023-10-05

    ndarray[所在0轴索引][所在1轴索引]

    或ndarray[所在0轴索引,所在1轴索引]

    0赞 · 0采集
  • WE_Xing 2020-05-01

    二维数组索引访问

    截图
    0赞 · 0采集
  • WE_Xing 2020-05-01

    一维数组索引访问

    截图
    0赞 · 0采集
  • fredwu 2020-04-30

    ddddd

    截图
    0赞 · 0采集
数据加载中...
开始学习 免费