DataFrame 使用apply函数返回两列数据并接受

方法一:

luduan_info[["STAKE_84X", "STAKE_84Y"]] = \
luduan_info.apply(lambda row:wgs84toutm(row["start_longitude"], row["start_latitude"]), axis=1, result_type="expand")

划重点result_type="expand"

方法二:

luduan_info["STAKE_84X"], luduan_info["STAKE_84Y"] = \
zip(*luduan_info.apply(lambda row:wgs84toutm(row["start_longitude"], row["start_latitude"]), axis=1))

你可能感兴趣的:(python)