using .remove seperately vs using it in tolist()
Because remove does the operation in place, modifying the list itself.  It doesn't return anything.
when I do this


    my_list = df.loc[df['ID']  == "9", ['ID1','ID2','ID3','ID4']].values.flatten().tolist()


I get the result


    my_list = ['-1','32','63','-1']


And then when I do my_list .remove('-1') I see


    my_list = ['32','63']


which is what I want to see .However when I try to do .remove in single step like


    my_list = df.loc[df['ID']  == "9",['ID1','ID2','ID3','ID4']].values.flatten().tolist().remove('-1')


then my_list is empty.
Why is this happening?