I have two data frames points and lines. Lines is far larger and has NaN values that I want to fill where points[UTC_TIME] is >= lines[SOL] and <= lines[EOL]. So far I have tried the pandas function merge as of, and it is running but only updating some NaN values.
navigation_merged = pd.merge_asof(points[["OBJECTID", "UTC_TIME"]].sort_values("UTC_TIME"),lines,left_on="UTC_TIME",right_on="SOL").drop(["SOL","EOL"],axis=1)
I'm open to any other suggestions. Here is a photo my data.
Here is a link to the 2 datasets on google drive Data
source https://stackoverflow.com/questions/72279921/merging-two-dataframes-based-on-a-condition-to-fill-nan-values
Comments
Post a Comment