I was working on recommendation system (RS) in python when I came across a serious problem: I couldn't access the set without changing its order.
e.g. Once I changed a set to list the order gets change. (In recommendation, system order is very important.)
final_prediction=set(df_final)-set(df1)
e.g.
>>> df_final=['a','x','z','p','s','j','b']
>>> df1=['b','j']
>>> set(df_final)-set(df1)
{'p', 'a', 's', 'z', 'x'}
Here df_final and df1 both are categorical variables
Although I used other approach, I had to scratch my butt's to change the code because it was giving perfect results using set thing and all other things were just working fine. I was in the final phase of my RS, but because of the set order I had to take other approach.
How do we access an set without changing the order?