I have two columns X and Y which are text columns. X is my feature and Y is my target variable. My Y variable consists of NaN values. I want to separate NaN values of Y into a separate data frame so that I will use them in my test dataset.
Y
1. aaa
2. bbb
3. ccc
4. NaN
5. NaN
6. ddd
Could anyone tell me how to separate the NaN rows?