I have been working with a data frame in which data record have useful information in square brackets and non-useful information outside the square bracket.
Sample Data frame:
1 Rohan is [age:10] with [height:130 cm].
2 Girish is [age:12] with [height:140 cm].
3 Both kids live in [location:Punjab] and [location:Delhi].
4 They love to play [Sport:Cricket] and [Sport:Football].
1 [age:10],[height:130 cm]
2 [age:12],[height:140 cm]
I have been trying this but cannot get the desired output.
df['b'] = df['Record'].str.findall('([[a-z \s]+])', expand=False).str.strip()
That doesn't seems to work.
I am new with Python.