Giter Club home page Giter Club logo

h3-py-notebooks's People

Contributors

ajfriend avatar camelia-c avatar dahnj avatar tenghu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

h3-py-notebooks's Issues

kring_smoothing is not averaging over its k-ring neighbors

I understand that the intention of the kring_smoothing function is to assign to each cell the "k-ring moving average" of its k-ring neighbors. If this is the idea (maybe the meaning is different), I think the function is not correct, it is quite similar but not the same.

Currently when you are merging:
.merge(df[[hex_col,metric_col]]).fillna(0)

You are assigning to each of the hexk neighbors of a cell the values of the cell value, so each new hexk cell will have the average of all of the cell for which it is a k-ring neighbor. This causes that new cells that were not present appear after the smoothing (so the metric 'mass' is conservative) because even if not present in the original set, the boundary cells will create new neighbors

As far as I understand, the way to smooth would be to assign to each cell the average of all its k-ring neighbors, like a moving mean but with hexagonal rings. Little modifications has to be made in the merge and group_by. Merging against hexk instead of hex_col (but to avoid the mess of columns names suffixes the trick is to temporarily rename the hex_col to hexk in the original data frame and performing a mean in the group by).
.merge(df.loc[:,[hex_col,metric_col]].rename(columns={hex_col:'hexk'}), how='left').fillna(0)
.groupby([hex_col])[[metric_col]].mean()

Dataset in urban_analytics notebook has wrong URL

The attempt to download Toulouse bus stops does not work because there is a misplaced 0 in the URL.

Solution

Change

https://data.toulouse-metropole.fr/explore/dataset/arrets-de-bus0/download/?format=geojson&timezone=Europe/Helsinki

to

https://data.toulouse-metropole.fr/explore/dataset/arrets-de-bus/download/?format=geojson&timezone=Europe/London&lang=fr

ValueError: 'left_df' should be GeoDataFrame, got <class 'pandas.core.frame.DataFrame'>

There's an error in https://nbviewer.jupyter.org/github/uber/h3-py-notebooks/blob/master/notebooks/unified_data_layers.ipynb

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-6f0a33b43f95> in <module>
     29 plt.title('hex-grid: nyc')
     30 # Intersect Hex Point with CT Polygon
---> 31 df_ct = geopandas.tools.sjoin(gdf, dfh, how="inner")
     32 df_ct.sample(3)
     33 

~/work/h3-py/uber/h3-py-notebooks/env/lib/python3.7/site-packages/geopandas/tools/sjoin.py in sjoin(left_df, right_df, how, op, lsuffix, rsuffix)
     35     if not isinstance(left_df, GeoDataFrame):
     36         raise ValueError(
---> 37             "'left_df' should be GeoDataFrame, got {}".format(type(left_df))
     38         )
     39 

ValueError: 'left_df' should be GeoDataFrame, got <class 'pandas.core.frame.DataFrame'>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.