Create new dataframe from repeating data in dataframe

Question:

I am currently trying to prepare a data for training and it is in yaml format so i managed to convert into a dataframe. The useful information is in the format of a subsegment making it impossible to access. I would like to take the column with the 3 subsegments and create and new dataframe since that’s the data I need

Dataset head:

Dataset head

Asked By: Angelos Zinonos

||

Answers:

frame3 = frame2.explode('annotations').reset_index(drop=True)

frame3 = pd.concat([frame3, frame3['annotations'].apply(pd.Series)], axis=1)
frame3 = frame3.drop(columns=['annotations'])
frame3 = frame3.loc[:,~frame3.columns.duplicated()].copy()

Using this solved my issue and opened the dataset

Answered By: Angelos Zinonos