【问题标题】:What is the opposite function of tobytes()?tobytes() 的反函数是什么?
【发布时间】:2021-12-09 22:04:27
【问题描述】:

我需要一个函数将字节转回 numpy 数组。有简单的方法吗?

Pickle 不起作用,因为我的数据太长,而且我尝试的所有其他操作也都失败了...我正在尝试通过套接字从客户端向服务器发送帧。

【问题讨论】:

标签: python numpy byte


【解决方案1】:

试试这个:x = np.frombuffer(n, dtype=i.dtype)

【讨论】:

    猜你喜欢
    • 2021-12-27
    • 2012-12-26
    • 2021-07-18
    • 2014-11-13
    • 1970-01-01
    • 1970-01-01
    • 2021-11-09
    • 2012-11-18
    相关资源
    最近更新 更多