txt file into pandas
Do you only need to differentiate between one or more spaces?
If so, maybe you can make use of a regular expression separator as listed in the pandas docs.
Something like this:
pd.read_csv(... sep='\s+', ...)

Also, consider adding the parameter delim_whitespace as such:
pd.read_csv(..., delim_whitespace=True, ...)