I am trying to use apache flink to convert latitude and longitude to WGS4 Co-ordinate using pyproj Library. I want to use Vectorized UDF. But whenever i pass data to VDUF. It throws error.
Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
@udf(input_types=[DataTypes.DOUBLE()], result_type=DataTypes.FLOAT(), udf_type="pandas")
def transform_to_wgs_lat(lat, lng, epsg):
new_lat, new_lng = Transformer.from_crs(epsg, 4326).transform(lat, lng)
return new_lat
sample Data:
lat = pd.Series([32.620359, 32.23561])
lng = pd.Series([-104.126000001, -104.20343])
proj = pd.Series([4269, 4269])
this is my function, and (lat, lng, epsg) all are series. In VDUF, Input must be Series And Output Must Also Be Series. So i need series of new latitude . But i am getting the above error.