I have the following DataFrame:
no | word | status | |
---|---|---|---|
0 | 0 | one | to_check |
1 | 1 | two | to_check |
2 | 2 | :) | emoticon |
3 | 3 | dr. | to_check |
4 | 4 | "future" | to_check |
5 | 5 | to | to_check |
6 | 6 | be | to_check |
I want to iterate trough each row to find quotes at word initial and final positions and create a DataFrame like this:
no | word | status | |
---|---|---|---|
0 | 0 | one | to_check |
1 | 1 | two | to_check |
2 | 2 | :) | emoticon |
3 | 3 | dr. | to_check |
4 | 4 | " | quotes |
5 | 4 | future | word |
6 | 4 | " | quotes |
7 | 5 | to | to_check |
8 | 6 | be | to_check |
I can strip quotes and split the word into three pieces but I got the this DataFrame, it overwrites the last two rows:
no | word | status | |
---|---|---|---|
0 | 0 | one | to_check |
1 | 1 | two | to_check |
2 | 2 | :) | emoticon |
3 | 3 | dr. | to_check |
4 | 4 | " | quotes |
5 | 4 | future | word |
6 | 4 | " | quotes |
I tried df.loc[index], df.iloc[index], df.at[index] but none of them helped me to extend the number of rows in the DataFrame.
Is it possible to add new rows at specific index without overwriting last two rows?