So, I split the sentences in a row into single words, and thus, the rows of my dataframe got lengthened. however, I am not satisfied with the new indexes.
0 0 I
1 don
2 '
3 t
4 think
5 any
What i would like, would be to make the index on the left swap places with the next one, and then, pass a argument like (Sentence: 'X'), where X would denote the original index of the sentence which the word belonged to.
0 Sentence:0 I
1 Sentence:0 don
2 Sentence:0 '
3 Sentence:0 t
4 Sentence:0 think
5 any
However,
df['index1'] = df.index
only lets me access the second index, and so i cannot get the indexes to swap positions.
How might I go about this?