Skip to content
New issue

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

关于乱码问题 #3

Open
mikiihuang opened this issue Apr 12, 2018 · 7 comments
Open

关于乱码问题 #3

mikiihuang opened this issue Apr 12, 2018 · 7 comments

Comments

@mikiihuang
Copy link

大佬您吼~~我按照您word2vec+聚类的代码跑了一遍,但是输出的csv文件的关键词一直存在着编码的问题,key那一列对应的是b"b'\xe8\x8d\xaf\xe7\x89\xa9' b'\xe5\x..这种格式,不知道您有没有好的建议可以修改?

@mikiihuang
Copy link
Author

哈哈哈哈哈 我改好啦~~~谢谢大佬的代码啦~~(#^.^#)

@ShawWang1991
Copy link

可以分享一下解决方法吗?

@gezimonkey
Copy link

哈哈哈哈哈 我改好啦~~~谢谢大佬的代码啦~~(#^.^#)

我也一样遇到这个问题了,请问怎么解决的?

@mikiihuang
Copy link
Author

哈哈哈哈哈 我改好啦~~~谢谢大佬的代码啦~~(#^.^#)

我也一样遇到这个问题了,请问怎么解决的?

具体改的哪里我记不清了,还是中文编码的问题,看一下那个读取的csv文件是什么编码方式,然后找代码里哪里读入的,你可以在读入的时候打印一下是不是这个时候就变成乱码了,然后一点一点的改。

@xiamaozi11
Copy link

把里面的encode都给去了就好了,楼主的是2.7的版本

@liyang0
Copy link

liyang0 commented May 30, 2020

name.append(word.encode('utf8'))把这种encode去掉就行了

@201901
Copy link

201901 commented Dec 23, 2020

image
name.append(word.encode('utf8'))把这种encode(‘utf8’)去掉就okok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants