Skip to content

Instantly share code, notes, and snippets.

@AlexKaravaev
Created July 29, 2019 18:03
Show Gist options
  • Save AlexKaravaev/d3d96706f1cd214d65947a42fe0f1b5b to your computer and use it in GitHub Desktop.
Save AlexKaravaev/d3d96706f1cd214d65947a42fe0f1b5b to your computer and use it in GitHub Desktop.
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