I have a DataFrame column with alphanumeric IDs - some numbers, some letters, some both. I am using read_csv to read the data and want to read all the values of this column as strings. I can't change the values in the underlying data.
I have tried to set the dtype for the column as an object
df = pd.read_csv(filename, dtype = {col: object})
I have also tried to use a converter to change all the values in the columns to strings.
df = pd.read_csv(filename, converters = {i: str for i in col})
However, I still end up with some non-string numbers (12345) and some string numbers ('12345') which mess up my aggregations.
Any suggestions? Thanks!