Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df1 = pd.read_csv(io.StringIO('''value1 value2 value3 ID text
- -0.1 0.35 -0.5 4 THIS
- -0.2 0.05 -0.7 3 IS
- 0.1 0.1 0.8 5 DRIVING'''), sep=' {2,}')
- __main__:4: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.
- df1
- Out[96]:
- value1 value2 value3 ID text
- 0 -0.1 0.35 -0.5 4 THIS
- 1 -0.2 0.05 -0.7 3 IS
- 2 0.1 0.10 0.8 5 DRIVING
- df2 = pd.read_csv(io.StringIO('''value1 value2 value3 ID text
- -0.1 0.35 -0.5 4 ME
- -0.2 0.05 -0.7 3 NUTS'''), sep=' {2,}')
- __main__:3: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.
- df2
- Out[98]:
- value1 value2 value3 ID text
- 0 -0.1 0.35 -0.5 4 ME
- 1 -0.2 0.05 -0.7 3 NUTS
- pd.concat([df1,df2], axis=0, ignore_index=True)
- Out[99]:
- value1 value2 value3 ID text
- 0 -0.1 0.35 -0.5 4 THIS
- 1 -0.2 0.05 -0.7 3 IS
- 2 0.1 0.10 0.8 5 DRIVING
- 3 -0.1 0.35 -0.5 4 ME
- 4 -0.2 0.05 -0.7 3 NUTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement