0

I have a problem with print array with unicode

sample_data.csv:

Петр
Андрей

Here is the code:

data = np.genfromtxt('sample_data.csv', delimiter=";")
print data
>>> ['\xd0\x9f\xd0\xb5\xd1\x82\xd1\x80', '\xd0\x90\xd0\xbd\xd0\xb4\xd1\x80\xd0\xb5\xd0\xb9']

But print only string show me this.

print data[0]
>>> Петр

How I can print array with correct strings?

Kein
  • 977
  • 2
  • 12
  • 32
  • Why do you need lists to print that way? Python is trying to protect you from unknown encoded data messing up your terminal by giving you *debugging* output; anything non-printable, non-ASCII data is shown as escape codes instead. – Martijn Pieters Oct 03 '16 at 15:49
  • Just in debug cases – Kein Oct 12 '16 at 00:55

0 Answers0