I am trying to read in a .txt file that looks like this (but not in table form):
date | value | ID |
---|---|---|
1990 | 12 | 01 |
1991 | 2.5 | 02 |
where the delimiters are 5 spaces and newlines at the end of each row. I am trying to use pd.read_table to read this in but when I do this:
data = pd.read_table(path, header=1, sep='s+', engine='python')
I get the following error: <>:1: SyntaxWarning: invalid escape sequence 's'
but if I do this: data = pd.read_table(path, header=1, delim_whitespace=True, engine='python')
I get this future warning: FutureWarning: The 'delim_whitespace' keyword in pd.read_table is deprecated and will be removed in a future version. Use ``sep='s+'`` instead
Any thoughts? Thanks!
Mya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.