Created
February 6, 2019 12:34
-
-
Save MaximePawlakFr/bb805d84f828a6fd58fd7afb77882a8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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