I am trying to filter out values from a pandas data-frame and then generate a column with those values. To further clarify myself here is an example
print (temp.head())
Index Work-Assigned Location
A R NL
B df MB
A NL
C SL NL
D RC MB
A RC AB
Now what I want to do is to filter out all the R and SL values from this data-frame and create another data-frame with just those values and the index. Something like this:
print (result.head())
Index R/SL
A R
B
C SL
D
I tried pivoting the data with Work-Assigned as the value, as you see certain value in the index column is repeated, but that didn't work.