I have dataframe like this:
id feature value
a aa 0.5
b ab 0.1
a ab 0.2
a cc 0.3
c ab 0.9
b bb 1
I have let's say total 4 unique values in feature column and all id might not correspond to all feature, so I want to another dataframe where id will correspond to value of feature it has or else 0 if that feature is not present.
e.g.:
feature_list = ['aa', 'ab', 'cc', 'bb']
id feature_vector
a [0.5, 0.2, 0.3, 0]
b [0, 0.1, 0, 1]
c [0, 0.9, 0, 0]