software:python [PaleoEarthLabs wiki]

PaleoEarthLabs wiki

One bucket of limited wisdom

Site Tools


software:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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]]
  
  
software/python.txt · Last modified: 2019/10/05 01:53 by christian