Skip to content

Instantly share code, notes, and snippets.

scw / navigator fix
Last active Sep 20, 2019
Patch Anaconda Navigator to use conda executable instead of root python wrapper to conda
View navigator fix
# NOTE: activate the environment containing Pro + Anaconda Navigator, and copy the
# navigator-pro.patch to your working directory.
conda install -y m2-patch
patch --binary %CONDA_PREFIX%\Lib\site-packages\anaconda_navigator\api\ navigator-pro.patch
View conda_api.patch
--- 2018-05-11 12:10:17.419642200 -0400
+++ 2018-05-11 12:14:31.058928700 -0400
@@ -406,12 +406,12 @@
if abspath:
if sys.platform == 'win32':
- python = join(self.ROOT_PREFIX, 'python.exe')
- conda = join(self.ROOT_PREFIX, 'Scripts', '')
+ python = join(self.CONDA_PREFIX, 'python.exe')
+ conda = join(self.ROOT_PREFIX, 'Scripts', 'conda.exe')
x = [5, 10, 15, 20, 30, 40, 50, 60, 100, 140]
def range_finder(seq):
it = iter(seq)
prev = next(it)
prev_diff = seq[1] - seq[0]
r = 0
for (i, item) in enumerate(it):
diff = item - prev
if diff != prev_diff:
scw / gist:e998a30ec8010467dbd94318ae42f2db
Created Aug 9, 2017
ArcGIS Pro 2.0 Python package list
View gist:e998a30ec8010467dbd94318ae42f2db
colorama 0.3.7 py35_0 defaults
cycler 0.10.0 py35_0 defaults
future 0.15.2 py35_0 defaults
matplotlib 1.5.3 np111py35_0e [arcgispro] esri
mpmath 0.19 py35_1 defaults
netcdf4 1.2.4 py35_0e [arcgispro] esri
nose 1.3.7 py35_1 defaults
numexpr 2.6.1 np111py35_0e [arcgispro] esri
numpy 1.11.2 py35_0e [arcgispro] esri
pandas 0.19.0 np111py35_0 defaults
scw / proenv.bat
Created Aug 8, 2017
Use call instead of invoking separate cmd.exe
View proenv.bat
@setlocal enabledelayedexpansion
@echo off
@CALL :normalizepath scripts_path "%~dp0"
@set env_text="%scripts_path%proenv.txt"
:: read the activte environment name
@set /p CONDA_NEW_ENV=<%env_text%
scw / __geo_interface__.rst
Last active Mar 21, 2017 — forked from sgillies/geo_interface.rst
A Python Protocol for Geospatial Data
View __geo_interface__.rst

Author: Sean Gillies Version: 1.0


This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.


from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import ctypes.wintypes
import os
# cyptes constants
# Second example from RasterToNumPyArray (arcpy)
A Python NumPy array is designed to deal with large arrays. There are many exist
ing Python functions that have been created to process NumPy arrays, the most no
ted being contained in the SciPy scientific computing package for Python. You ma
y want to convert an ArcGIS raster to a NumPy array to
1. Implement one of the many existing Python functions that can be applied to a
NumPy array (for example, run filters on the data, perform multidimensional
scw /
Last active Jun 10, 2016
Example conda steps
# step 0 -- install miniconda into ~/miniconda
cd ~/miniconda/bin
# running this will drop you into the 'root' conda environment,
# the one that has the conda executable
source ./activate root
# to test, get the version of conda back
conda --version
# Now, you can run the conda command, and create a new environment.
# Here's an example installing a geo stack. Note I reference the
# conda-forge channel '-c conda-forge' because geopandas isn't in
scw /
Last active Jan 26, 2016
Download Singapore region data
#!/usr/bin/env bash
# source map:
echo "You must abide by the terms of use of this data:"
echo ""
echo "Agree to terms? (y|n)"
read input
if [ ${input} == 'y' ]; then