We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在章节https://github.com/teadocs/numpy-cn/blob/master/docs/user/basics/io.md中,运行一下代码data = "1, 2, 3, 4, 5, 6" np.genfromtxt(BytesIO(data), delimiter=",")出现TypeError: a bytes-like object is required, not 'str'错误 我得环境是python3.7. 此处的代码应该改为np.genfromtxt(BytesIO(data.encode()), delimiter=",")就可以正常运行
data = "1, 2, 3, 4, 5, 6" np.genfromtxt(BytesIO(data), delimiter=",")
np.genfromtxt(BytesIO(data.encode()), delimiter=",")
The text was updated successfully, but these errors were encountered:
你可以提RP
Sorry, something went wrong.
改成StringIO就对了,BytesIO是对byte类型数据进行操作的,官网可能写错了。
No branches or pull requests
在章节https://github.com/teadocs/numpy-cn/blob/master/docs/user/basics/io.md中,运行一下代码
data = "1, 2, 3, 4, 5, 6" np.genfromtxt(BytesIO(data), delimiter=",")
出现TypeError: a bytes-like object is required, not 'str'错误我得环境是python3.7.
此处的代码应该改为
np.genfromtxt(BytesIO(data.encode()), delimiter=",")
就可以正常运行The text was updated successfully, but these errors were encountered: