I have a CSV file with a column that contains a string with vehicle options.
Brand Options Toyota Color:Black,Wheels:18 Toyota Color:Black, Chevy Color:Red,Wheels:16,Style:18 Honda Color:Green,Personalization:"Customer requested detailing" Chevy Color:Black,Wheels:16
I want to expand the "Options" string to new columns with the appropriate name. The dataset is considerably large so I am trying to name the columns programmatically (ie: Color, Wheels, Personalization) then apply the respective value to the row or a null value.
Adding new data
import pandas as pd
Cars = pd.read_csv("Cars.CSV") # Loads cars into df
split = Cars["Options"].str.split(",", expand = True) # Data in form of {"Color:Black", "Wheels:16"}
split[0][0].split(":") # returns ['Color', 'Black']
What is an elegant way to concat these lists to the original dataframe Cars without specified columns?