I have a list with numbers:
[18, 22, 20]
and a dataframe:
Id | node_id
UC5E9-r42JlymhLPnDv2wHuA | 20
UCFqcNI0NaAA21NS9W3ExCRg | 18
UCrb6U1FuOP5EZ7n7LfOJMMQ | 22
list numbers map to node_id numbers. The order of the node_id numbers matters, they must be in the order of the list numbers.
So the dataframe is in the wrong order.
I need to sort the dataframe by the list values.
End result should be:
Id | node_id
UCFqcNI0NaAA21NS9W3ExCRg | 18
UCrb6U1FuOP5EZ7n7LfOJMMQ | 22
UC5E9-r42JlymhLPnDv2wHuA | 20
How can I do this?