Created
July 29, 2019 18:03
-
-
Save AlexKaravaev/d3d96706f1cd214d65947a42fe0f1b5b 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
df['lon'] = df['Адрес'].apply(lambda row: georef[row][0]) | |
df['lat'] = df['Адрес'].apply(lambda row: georef[row][1]) | |
def numberIt(cell): | |
if not cell or '*' in cell: | |
return None | |
tokens = cell.split(' ') | |
if ('менее' in tokens): | |
return float(tokens[-1])/2 | |
else: | |
return float(cell) | |
df.iloc[:,2:9] = df.iloc[:,2:9].applymap(numberIt) | |
df.to_csv('spb_pollution_record.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment