?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 三菱FX系列PLC上位机串口下指令置位M64和M65,这两条指令分别是什么呢?
  • ¥15 有关结冰模拟程序咨询
  • ¥15 ubuntu服务器配置dns域名后无法访问其他域名
  • ¥50 本人复制了一个关于股票指标的代码,但是运行失败,有没有人帮我解决一下
  • ¥50 用matlab和numeca做透平机械流体力学和热力学模拟 价格可议
  • ¥15 Unity3D WebView
  • ¥20 论文AlphaTensor复现(有偿)
  • ¥15 (有偿)在ANSYS中 .anf文件
  • ¥45 关于#芯片#的问题:组合逻辑电路设计
  • ¥15 基与机器学习和时间序列分析预测养老服务需求趋势