我需要在python中显示和绘制二进制文件。我尝试使用此代码:
import matplotlib.pyplot as plt
import numpy as np
path= "filename.bin"
dataArray= np.load(path)
test= dataArray.shape
print(test)
print (dataArray)
print (dataArray.shape)
plt.plot(dataArray.T)
plt.show()
但是,它不起作用。 这是错误:
"Failed to interpret file %s as a pickle" % repr(file))
IOError: Failed to interpret file 'filename.bin' as a pickle