Created
July 31, 2018 10:30
-
-
Save yaronv/01a7e4856f7c3f1736f059b42fe30344 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train_data = pd.DataFrame(columns = ['id','text','response','name']) | |
prev_msg = '' | |
for index, row in df.iterrows(): | |
if prev_msg != '': | |
tmp = pd.DataFrame({'text': [prev_msg], 'response': [row['message']], 'id': [row['id']], 'name': [row['name']]}) | |
train_data = train_data.append(tmp[['id','text','response','name']], ignore_index=True) | |
prev_msg = row['message'] | |
display(train_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment