For example I have the next DataFrame:
a = [{'qty': 1, 'color': 'red,black,green', 'name': 'a'}, {'qty': 5, 'color': 'white',
'name': 'b'}, {'qty': 7, 'color': 'yellow,orange', 'name': 'c'}]
df = pd.DataFrame(a)
print(df)
I need to check column df['color']
and if the field contains values separated by a comma, then leave the first value, and create similar entries for all the others
I need to get the following result, screenshot below: