When applying the user defined function nearest() to the GeoDataFrame df1 you get the below error:
AttributeError: 'Series' object has no attribute 'get_values'
This is caused by this line in the function:
value = df2[nearest][src_column].get_values()[0]
And that's because pandas.DataFrame.get_values() was deprecated in Pandas since version 0.25.0 (I'm using Pandas v1.0.4 and Geopandas v0.7.0).
The below code works:
value = df2[nearest][src_column].values[0]