Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = ''' query tags
- 0 hi intro
- 1 how are you wellb
- 2 hello intro
- 3 what's up wellb
- 4 how's life wellb
- 5 bye gb
- 6 see you later gb
- 7 good bye gb
- 8 thanks gratitude
- 9 thank you gratitude
- 10 that's helpful gratitude
- 11 I am great revertfine
- 12 fine revertfine
- 13 I am fine revertfine
- 14 good revertfine'''
- import pandas as pd
- from io import StringIO
- fd = StringIO(text) # create file-like object in memory
- df = pd.read_table(fd, sep="\s{2,}") # read from file-like object, use regex to seperate columns
- #df = pd.read_csv(fd, sep="\s{2,}")
- print(df.columns)
- print(df)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement