I'm trying to read a text file the way I usually do with Pandas, but for some reason the whole line is getting read as one column:
import pandas as pd
from StringIO import StringIO
a='''
TRE-G3T- Triumph- 0.000 11/06/2013 313585.10 1765.00000 11/06/2013 313600.10 41 20 54.57907 -70 38 14.25924 -30.400 -1.379 893059.006 2588821.543 2834.294 -19545.615 -45.849 0.985 1.058 3.399 3.694 -15.203 1.099 1.0000 6 6.37 4 0.000 I -0.084 0.086 -0.059 0.000 0.000 0.000 363026.471 4578737.512 -30.400
TRE-G3T- Triumph- 0.000 11/06/2013 313585.20 1765.00000 11/06/2013 313600.20 41 20 54.61145 -70 38 14.22044 -30.332 -1.311 893061.933 2588824.850 2835.196 -19544.617 -45.779 0.944 1.015 3.313 3.592 -15.135 -3.365 1.4883 6 6.35 4 0.001 I 0.833 -0.485 -1.570 0.000 0.000 0.000 363027.391 4578738.493 -30.332
TRE-G3T- Triumph- 0.000 11/06/2013 313585.30 1765.00000 11/06/2013 313600.30 41 20 54.48685 -70 38 14.10862 -29.190 -0.169 893070.589 2588812.325 2837.797 -19548.465 -44.651 0.950 1.017 3.254 3.539 -13.994 -8.197 1.0000 6 5.70 4 0.001 I -0.158 0.003 0.061 0.000 0.000 0.000 363029.917 4578734.602 -29.190
'''
df = pd.read_csv(StringIO(a),delimiter='r\s+')
shape(df)
(3,1)
I'm sure it's something simple, but I've been looking at the docs and examples and I can't figure it out!