【问题标题】:How to fix TypeError: order must be str, not int如何修复 TypeError:order 必须是 str,而不是 int
【发布时间】:2022-01-15 15:46:45
【问题描述】:

我正在使用第 3 方代码来处理一些用 python 编写的文件。错误代码是这样的:

outfile.writeframes(int16(output.ravel(1)*32767.0).tostring())

不确定我应该如何修复它,但这是在 Python 3.9 上运行的。

【问题讨论】:

    标签: python-3.x string debugging typeerror


    【解决方案1】:

    看起来像 paulstretch 或类似的,这对我有用

    outfile.writeframes(int16(output.ravel('F')*32767.0).tostring())
    

    检查:https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.ravel.html#numpy.ravel

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-08
      • 1970-01-01
      • 2019-04-23
      • 2020-07-16
      • 2018-07-23
      • 2018-04-26
      • 1970-01-01
      相关资源
      最近更新 更多