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

read Arabic CSV file with Python3.6 #94

Open
Nisreenelhassan opened this issue Oct 18, 2018 · 1 comment
Open

read Arabic CSV file with Python3.6 #94

Nisreenelhassan opened this issue Oct 18, 2018 · 1 comment

Comments

@Nisreenelhassan
Copy link

Hello,
I want to read and write an Arabic CSV file using pandas in python3,6 so this is the code

-- coding :utf8 --

import pandas as pd
#import sys
df = pd.read_csv("C:\Users\DELL\Desktop\test_model.csv", encoding = 'utf-8')
print(df)
i got this error when i ran the module :

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

RESTART: C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\read_csv.py
Traceback (most recent call last):
File "pandas_libs\parsers.pyx", line 1134, in pandas._libs.parsers.TextReader._convert_tokens
File "pandas_libs\parsers.pyx", line 1240, in pandas._libs.parsers.TextReader._convert_with_dtype
File "pandas_libs\parsers.pyx", line 1256, in pandas._libs.parsers.TextReader._string_convert
File "pandas_libs\parsers.pyx", line 1494, in pandas._libs.parsers._string_box_utf8
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\read_csv.py", line 4, in
df = pd.read_csv("C:\Users\DELL\Desktop\test_model.csv", encoding = 'utf-8')
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\io\parsers.py", line 678, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\io\parsers.py", line 446, in _read
data = parser.read(nrows)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\io\parsers.py", line 1036, in read
ret = self._engine.read(nrows)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\io\parsers.py", line 1848, in read
data = self._reader.read(nrows)
File "pandas_libs\parsers.pyx", line 876, in pandas._libs.parsers.TextReader.read
File "pandas_libs\parsers.pyx", line 891, in pandas._libs.parsers.TextReader._read_low_memory
File "pandas_libs\parsers.pyx", line 968, in pandas._libs.parsers.TextReader._read_rows
File "pandas_libs\parsers.pyx", line 1094, in pandas._libs.parsers.TextReader._convert_column_data
File "pandas_libs\parsers.pyx", line 1141, in pandas._libs.parsers.TextReader._convert_tokens
File "pandas_libs\parsers.pyx", line 1240, in pandas._libs.parsers.TextReader._convert_with_dtype
File "pandas_libs\parsers.pyx", line 1256, in pandas._libs.parsers.TextReader._string_convert
File "pandas_libs\parsers.pyx", line 1494, in pandas._libs.parsers._string_box_utf8
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: invalid continuation byte

@afifaarg
Copy link

afifaarg commented Mar 9, 2023

hello did you find a solution ? ,, i've being looking so long with no valid solution

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

2 participants