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

encoding problem when reading csv file #4

Open
mattiat opened this issue Jul 25, 2019 · 3 comments
Open

encoding problem when reading csv file #4

mattiat opened this issue Jul 25, 2019 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mattiat
Copy link
Collaborator

mattiat commented Jul 25, 2019

PCA works with our usual colaus1.focus.mr file however when I made a smaller csv file just by copy-pasting part of our original file it failed in reading the file. It seems to be an encoding problem using csv.reader. One way to fix it is to use pandas.read_csv() which doesn’t seem to have this problem.

@mattiat mattiat added the bug Something isn't working label Jul 25, 2019
@mattiat
Copy link
Collaborator Author

mattiat commented Jul 25, 2019

I remove a few lines (simply using Excel) from colaus1.focus.mr and the method run without error.

@BKhalili Can you share the file? What program did you use when you copy/pasted?
I think it might have changed the encoding...
https://en.wikipedia.org/wiki/Endianness
https://stackoverflow.com/questions/17912307/u-ufeff-in-python-string

@mattiat mattiat added the help wanted Extra attention is needed label Jul 25, 2019
@BKhalili
Copy link

I also used Excel but copied few lines to a new file. Yes as I mentioned it is an encoding problem. However I think we should make sure that this error will not occur for other users. For example pandas read_csv doesn't have this problem. I will email you the data file I created.

@mattiat mattiat removed the help wanted Extra attention is needed label Jul 25, 2019
@BKhalili
Copy link

This problem still exists.

@mattiat mattiat added the help wanted Extra attention is needed label Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants