On Wed, Jan 15, 2014 at 3:58 PM, Julian Taylor < jtaylor.deb...@googlemail.com> wrote:
> > fileContent=loadtxt(filePath,dtype='S') > > this gives you bytes not a string, this can only be fixed by adding new > dtypes, or changing the behavior or dtype 'S', but yes, the other thread. But the OP's problem was not that s/he got bytes, but that the content was wrong -- he got the repr of bytes in a py3 string. - > same as using python str you get the output originally posted, bytes > representation with duplicated slashes. > This is a bug in loadtxt we need to fix independent of adding new dtypes. > yup. > It is also independent of the encoding of the text file, loadtxt doesn't > seem to be able to open other encodings than ascii/utf8 at all and has > no option to tell it what the file is. > a key missing feature -- and I doubt it does utf-8 right, either. as mentioned in my earlier mail this works for ascii: > > np.loadtxt('test.txt',dtype=bytes).astype(str) > thanks -- I wasn't sure what astype would do for that. and what are you getting then, unicode or ascii? Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion