?ww. 2019-11-14 23:37 采纳率: 0%
浏览 326
已采纳

为什么print(arr.ravel('F'))无法执行

图片说明

  • 写回答

1条回答 默认 最新

  • 毕小宝 博客专家认证 2019-11-15 10:04
    关注

    不是没有生效,而是你针对的是 arr 是一维数组做 reval 散开操作,C 和 F 选项根本就没区别,你应该对一个二维数组测试区别:
    图片说明
    这就能看到 C 和 F 的区别了
    具体区别官方是这样的

    order : {‘C’,’F’, ‘A’, ‘K’}, optional
    The elements of a are read using this index order. ‘C’ means to index the elements in row-major, C-style order, with the last axis index changing fastest, back to the first axis index changing slowest. ‘F’ means to index the elements in column-major, Fortran-style order, with the first index changing fastest, and the last index changing slowest. Note that the ‘C’ and ‘F’ options take no account of the memory layout of the underlying array, and only refer to the order of axis indexing. ‘A’ means to read the elements in Fortran-like index order if a is Fortran contiguous in memory, C-like order otherwise. ‘K’ means to read the elements in the order they occur in memory, except for reversing the data when strides are negative. By default, ‘C’ index order is used.
    

    C 是按行有限展开的, F 是每一列进行展开的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题