I have a DataFrame
like this:
df = pd.DataFrame({'orig': ['ORD', 'AUS', 'AUS'], 'dest': ['LAX', 'JFK', 'JFK']}
I'd like to be able to turn that into a DataFrame
that has two columns orig
and dest
that contain all of the unique combinations of orig
and dest
in df
like this:
orig dest
1 ORD LAX
2 AUS JFK
so that I can iterate over each row and call a separate method that I've created for each orig
and dest
.
Is this possible? Most other answers that I've seen on here don't return a DataFrame
object.