meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
software:python [2019/10/05 01:20] christian [Pandas/Geopandas] |
software:python [2019/10/05 01:53] (current) christian [Pandas/Geopandas] |
||
---|---|---|---|
Line 48: | Line 48: | ||
* Going from a regular dataframe to geopandas data frame: ``gdf = geopandas.GeoDataFrame(df, geometry=geopandas.points_from_xy(df.Longitude, df.Latitude))`` -- [[https://geopandas.readthedocs.io/en/latest/gallery/create_geopandas_from_pandas.html|via Geopandas doc]] | * Going from a regular dataframe to geopandas data frame: ``gdf = geopandas.GeoDataFrame(df, geometry=geopandas.points_from_xy(df.Longitude, df.Latitude))`` -- [[https://geopandas.readthedocs.io/en/latest/gallery/create_geopandas_from_pandas.html|via Geopandas doc]] | ||
* Obtaining unique values for Multi-index levels: ``concatdf.index.unique(level=1)`` | * Obtaining unique values for Multi-index levels: ``concatdf.index.unique(level=1)`` | ||
+ | * Drop a level of multi-index into a column: ``df.reset_index(level=[...])`` - via [[https://stackoverflow.com/questions/20110170/turn-pandas-multi-index-into-column|StackOverflow]] | ||