[英]how to apply dataframe rows into a defined function
I have a function so that I could add a name and its lats and longs and at first I add them line by line我有一个函数,这样我就可以添加一个名称及其纬度和经度,首先我逐行添加它们
`def add_coordinate():
# Coordinate location name
name: str
# Longitude
longitude: Numeric
# Latitude
latitude: Numeric
`
geo = Geo()
# Add coordinate point, add name and latitude and longitude
geo.add_coordinate(name="VKO",longitude=55.60,latitude=37.26)
geo.add_coordinate(name="MLE",longitude=4.18,latitude=73.52)
Now I have a dataframe with the data I wanted to add, how could I loop the dataframe to apply these rows to the function?现在我有一个包含要添加的数据的数据框,如何循环数据框以将这些行应用于函数?
IATA![]() |
LAT2 ![]() |
LONG2![]() |
---|---|---|
VKO ![]() |
55.600000 ![]() |
37.267778 ![]() |
MLE ![]() |
4.184722 ![]() |
73.518889 ![]() |
DWC![]() |
24.916944 ![]() |
55.168056 ![]() |
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.