Helmut Jarausch <jarau...@skynet.be> wrote:
> I have a machine with a non-UTF8 local.
> I can't figure out how to make numpy.genfromtxt work
[...]
> #!/usr/bin/python3
> import numpy as np
> import io
> import sys
> 
> inpstream = io.open(sys.stdin.fileno(), "r", encoding='latin1')
> 
> data = np.genfromtxt(inpstream)

Hi Helmut, numpy.genfromtxt wants bytes, not str. Use
  inpstream = io.open(sys.stdin.fileno(), "rb")
or simply
  inpstream = sys.stdin.buffer

Ciao
Marc
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to