I need to convert this string into rooms and their specific value with the help of python code. I tried with
df1[['Master Bedroom', 'bedroom','bedroom','bedroom','study room']] = df['Area(sq.ft)'].str.split(',',1, expand=True)
but unfortunately its saying
ValueError: Columns must be same length as key
Below is the input:
0 | Area(sq.ft)
-----------------------------------------------------------------------
1 | Master Bedroom, 181, Bedroom, 153.08, Bedroom, 143, Bedroom, 132,
| Study Room, 72.75
-----------------------------------------------------------------------
2 | Master Bedroom, 144.83, Bedroom, 126.88, Bedroom, 142.62
Below is the output:
| Master Bedroom | Bedroom | Bedroom | Bedroom | Study Room
----------------------------------------------------------------
| 181 | 153.08 | 143 | 132 | 72.75
| 144.83 | 126.88 | 142.62 | 0 | 0