I have two dataframes:
df_1 = pd.DataFrame(columns=["pointid","lat","lon"],data=[[1,41.792145,3.046884],[2,41.799834,3.051082],[3,41.813694,3.063463], [4,41.817673,3.067025]])
df_2 = pd.DataFrame(columns=["id","point_from","point_to"],
data=[[1,1,2],[2,1,3],[3,2,3]])
I want to merge them in order to get a new dataframe df_3 with the following columns (example of 1 row):
id point_from point_to lat_from lon_from lat_to lon_to
1 1 2 41.792145 3.046884 41.799834 3.051082
How can I do this?