Python 3.7
pandas 0.24.2
Within a Python script, I am loading a zip of many CSVs from a remote server. I am then reading a subset of these CSVs to utf-8 strings, after which I attempt to read each CSV string into a dataframe using .read_csv(). Attempts to carry out this action are failing. For a single string:
large_string = '"num","domain_name",...,"clientTransferProhibited","","","";'
df = pd.read_csv(large_string, sep=',', engine='python')
Expected: return a dataframe and run rest of script.
Observed: when run from terminal, all of large_string gets printed to the console and then the script ends (i.e. does not complete other code, but no error messages). When run in PyCharm, same thing happens, but I also see that it is stalling out down the pandas stack:
pandas>io>parsers>common.py
on line 427:
f = open(path_or_buf, mode, errors='replace', newline="")
In PyCharm debug, within the common.py frame, I am able to see that the exception Error 63 File name too long is being thrown (although for some reason this exception never gets printed to console).
What is going on here? Is read_csv misinterpreting my data as a filepath? How do I resolve this?