When calling numpy.loadtxt on file containing strings as follows:
import numpy as np
datestxt = np.loadtxt("NYSE_dates.txt", dtype=str)
Where NYSE_dates.txt is simply a list of dates (could be anything really):
["b'7/5/1962'" "b'7/6/1962'" "b'7/9/1962'" ..., "b'12/29/2020'"
As you can see, all the strings have been bytes-casted, then stringified through conv, as you would get the same result from str(str('12/31/2020').encode('latin1')), per conv & compat.asbytes.
After looking at the code, it appears that all strings are bytes-casted with asbytes(...) pretty much throughout, as for example in split_line(...), so this must mean every routine in the module is broken.
I also have that issue. This is very very annoying; basically you can't use loadtxt in Python3.
Temporary solution: I removed all asbytes() calls in the loadtxt method.
Yeah, I remember thinking something was fishy in there when I looked through the code.
For the record, I am running into the same issue with datetime64 inputs, leading to a parsing error of the form: Error parsing datetime string "b'2013-01-02'". To work around this, I had to create a converter for that column:
Error parsing datetime string "b'2013-01-02'"
This would be fine in production code but is highly non-pretty for training material...
Pushing off to 1.11.
work-around - run iconv on the file first.
pushing off to 1.12.