I am new to pandas dataframe and have the following question.
I have 3 dataframes coming from reading CSV files:
DataFrame 1 is named
pdDop
and has the following entries:DOP_WNC DOP_TOW DOP_NRSVS DOP_PDOP DOP_VDOP DOP_HDOP DOP_TDOP 1928 424800.0 4 5.81 5.36 2.24 2.72 1928 424801.0 4 5.81 5.36 2.24 2.72 1928 424802.0 4 5.80 5.35 2.24 2.72 1928 424803.0 4 5.80 5.35 2.24 2.72 1928 424804.0 4 5.80 5.35 2.24 2.72 1928 424805.0 4 5.80 5.35 2.24 2.72
DataFrame 2 is named
pdGeod
and has the following entries:GEOD_TOW GEOD_MODE GEOD_2D/3D GEOD_Error GEOD_NrSV GEOD_Latitude GEOD_Longitude GEOD_Height 424800.0 1 0 0 4 0.8874 0.0767 150.4975 424801.0 1 0 0 4 0.8874 0.0767 150.5277 424802.0 1 0 0 4 0.8874 0.0767 150.5579 424803.0 1 0 0 4 0.8874 0.0767 150.5931 424804.0 1 0 0 4 0.8874 0.0767 150.6214
Dataframe 3 is called
pdSatVis
and has following entries:VISIBILITY_TOW VISIBILITY_SVID VISIBILITY_AZIMUTH VISIBILITY_ELEVATION 426175.0 92 54.50 35.43 426175.0 100 108.22 26.00 426175.0 88 49.29 10.48 426175.0 89 278.29 17.39 426176.0 92 54.50 35.43 426176.0 100 108.22 26.00 426176.0 88 49.29 10.48 426176.0 89 278.29 17.39 426177.0 92 54.48 35.42 426177.0 100 108.23 25.98 426177.0 88 49.28 10.45 426177.0 89 278.27 17.38 426178.0 92 54.48 35.42
I would like to create 1 dataframe which combines based on the *_TOW
(Time Of Week) column which is in each dataframe. Remark that the last dataframe pdSatVis
has several lines with the VISIBILTY_TOW
value that corresponds only to 1 row in both pdDop
and pdGeod
.
You can either add a new column to merge on:
or provide the columns to merge on explicitly: