Workflow is :
- Read CSV file using Python's pandas library and get Variation Column
- Variation Column data is
Variation
----------
Color Family : Black, Size:Int:L
Color Family : Blue, Size:Int:M
Color Family : Red, Size:Int:Xl
- But I want to print this data in different column with sorted data and save its as a xlsx
Color Size
------- ------
Black L
Blue M
Red XL
My code is :
#spliting variation data#taking variation column data in a var
get_variation = df_new['Variation'] #Splitting Column data
for part in get_variation:format_part = str(part)data = re.split(r'[:,]' , format_part)df_new['Color'] = data[1]df_new['Size'] = data[4]
But my output is coming as
Color Size
------ ------
Black L
Black L
Black L