Useful links and snippets regarding Python and Jupyter notebooks
# py3 from urllib import parse parse.unquote("""TheURLString""") # or in py2.7 import urllib urllib.unquote("theURL").decode('utf8')
*.prj
files to proj4-Syntax as required by QGIS using the gdal python module (via GIS on Stackexchange:import sys from osgeo import osr prjtxt = """PROJCS["your_crs",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["the_prj"],PARAMETER["Central_Meridian",0.0],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Latitude_Of_Origin",0.0],PARAMETER["Standard_Parallel_1",-10],PARAMETER["Standard_Parallel_2",50],UNIT["Meter",1.0],AUTHORITY["me",123456]]""" srs = osr.SpatialReference() print 'Proj4 is: %s' % srs.ExportToProj4() Proj4 is: <string with proj4 parameters follows>
df.col2 = df.col2.values[::-1]
via StackOverflowpd.concat(data, axis=1)
via StackOverflowconcatdf.xs('MIndexValue', level='MIndexName')
- via Pandas documentation and StackOverflowgdf = geopandas.GeoDataFrame(df, geometry=geopandas.points_from_xy(df.Longitude, df.Latitude))
– via Geopandas docconcatdf.index.unique(level=1)
df.reset_index(level=[…])
- via StackOverflowmyDict = { 'a': 1, 'b': 2, 'c': 3}
, df[newCol] = df[oldCol].map( myDict )
%run setup.py install
and the compiled module is then installed in the Canopy's User\Lib\site-packages
directory. Easy.