Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am new to Python Pandas and working on a small application where in i want to read my excel file having data in Hindi Language.

Issue I am facing is , pandas is not able to read hindi words and is placing some arbitary '?' symbol.

I have tried adding encoding to utf-8 but that is also not working.

My Excel Data :

enter image description here

Python Code :

df = pd.read_csv("Vegaretable_List.csv", encoding='utf-8')

Output :

['?? ' '??? ' '???? ' '????? ' '????']

Any help will be appreciable. Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
385 views
Welcome To Ask or Share your Answers For Others

1 Answer

The problem shouldn't occur if the file is read in using the same encoding it was created with.

If you get "???", it means the csv or excel file was saved with a different encoding.

Here is a table of the standard encodings.

Also, you could open your file in an appropriate program, and save it with UTF-8, in order to read with your code.

Also See:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...