diff --git a/doc/source/io.rst b/doc/source/io.rst index 48fe6e24dda9f..3d099bc291244 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -326,7 +326,8 @@ result in byte strings being decoded to unicode in the result: .. ipython:: python - data = 'word,length\nTr\xe4umen,7\nGr\xfc\xdfe,5' + # a latin-1 encoded bytestring + data='word,length\nTr\xc3\xa4umen,7\nGr\xc3\xbc\xc3\x9fe,5'.decode('utf8').encode('latin-1') df = pd.read_csv(StringIO(data), encoding='latin-1') df df['word'][1]