My data has some NaN values in its first column. To replace these NaN values, I want to look to the adjacent value in the next column and put a specific value as replaceNaN. Here is the csv data:
,Release,SubRelease,ReleaseDate,TypeofRelease,Package
0,LTE,TL101,2017-09-27,Major Update,2.0.4
1,LTE,TL101,2017-09-26,Normal Update,3.1
2,NaN,TL209,2017-09-25,Major Update,3.2
3,5G,5GS,2017-09-25,Delivery,1.1
4,NaN,5GM,2017-09-24,Release,1.0
5,LTE,FL18A,2017-09-23,Normal Update,3.0
For eg, there is a NaN value in the 3rd row of Release. I want to look at the SubRelease column of the same row, and say that since the value here is "TL209", I want to replace the NaN with the value "LTE". Similarly, if the value in SubRelease column is "5G19", I want to replace the NaN with "5G" for Release.
The first thing that comes to my mind is using regex, specify to look if the value in SubRelease column contains or begins with the text "5G". But I don't know how to implement this. Or is there any better approach?
Easier to view csv data:
