I have a data frame and the first column is populated with strings. I want to create rules such that the whole row of the data frame is deleted if the first word in the string of the first column only contains one letter, and for all other strings everything after the first space will be deleted (only in that column the row will be kept).
An example is as follows:
| Column 1 | Many other columns |
|---|---|
| G Gsrnrf | xxxxxxx |
| DNN fdffk | xxxxx |
| OCGN fnjfdj | xxxxx |
In the first row there is only one letter so the whole row should be deleted.
In the second row, the first column should only contain 'DNN' (i.e. 'fdffk' is deleted and the rest of the row is kept)
In the third row, the first column should only contain 'OCGN' and delete 'fnjfdj'.