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
# bound of min/max latitude/longitude/height for Tanzania | |
bound_df = dfX[(dfX['latitude']<-0.5)&(dfX['longitude']>25)&(dfX['gps_height']>0)] | |
# mean of geographical data in each bucket | |
mean_geo_df = bound_df.groupby(['basin',])['latitude','longitude','gps_height'].mean() | |
assert(mean_geo_df.shape[0] == len(dfX['basin'].unique())) | |
# Out[31]: mean_geo_df | |
# latitude longitude gps_height | |
# basin | |
# Internal -4.1370 35.4715 1474.5504 | |
# Lake Nyasa -10.021 34.7726 1524.6542 | |
# Lake Rukwa -7.4896 31.5001 1415.1373 | |
# Lake Tanganyika -4.9386 30.3982 1270.0632 | |
# Lake Victoria -1.8684 34.0041 1329.2650 | |
# Pangani -3.8493 37.5468 1102.2577 | |
# Rufiji -8.4833 35.8520 1087.7806 | |
# Ruvuma / Southern Coast -10.547 38.1568 455.0583 | |
# Wami / Ruvu -6.7127 38.1703 308.9142 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment