Skip to content

Instantly share code, notes, and snippets.

@MaximePawlakFr
Created February 6, 2019 12:34
Show Gist options
  • Save MaximePawlakFr/bb805d84f828a6fd58fd7afb77882a8a to your computer and use it in GitHub Desktop.
Save MaximePawlakFr/bb805d84f828a6fd58fd7afb77882a8a to your computer and use it in GitHub Desktop.
def sampleToPoint(sample, prefix):
latStr = sample[prefix + "_lat"]
lat = stringPositionToInt(latStr)
lngStr = sample[prefix + "_lon"]
lng = stringPositionToInt(lngStr)
point = [lat, lng]
return point
# Set points from lat and long
steps = ["prec", "interv", "suivant"]
for step in steps:
df[step + "_point"] = df.apply(lambda x: sampleToPoint(x, step), axis=1)
df.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment