I have a dataframe df1 with two columns: CODE & RANK
CODE RANK
100 12 1
212 6 2
358 4 3
342 10 4
111 8 5
My dataframe is ordered by Rank. I don't want to change completely the sorting rule but want to move to head some rows generated by a filter:
df1[df1['RANK'] >= 4]]
The result should then be:
CODE RANK
342 10 4
111 8 5
100 12 1
212 6 2
358 4 3
Do you know how I can do it properly?
Thanks for help