I have the following problem with this example data based in a bigger data with 420 rows.
The columns are "m2
", "rooms
" , and "toilets
". I'm using pandas and python.
I would like to transfer the strings that contain the words 'room
','rooms
','toilet
' and 'toilets
' from the column 'm2
' and the column 'rooms
' to their corresponding columns, in this case 'rooms
' and 'toilets
'. I have problems trying to transfer this values and keeping the row of this information into the data.
使用str.contains的条件
申请np.where
平方米的厕所 0 12 1室2洗手间 1 1室1室1洗手间 2 1厕所NaN NaN 3 14 2房间1卫生间 4 3房间3房间NaN