This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import pandas as pd | |
uid = "GEO_ID" # <-- set the column that will hold the unique ID | |
directory = "." # <-- set the directory that you want to read from here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
top:30px; | |
margin:30px; | |
padding:30px; | |
} | |
.btn-group { | |
font-size:0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gen_cat | prod_fam | prod_type | description | PUC_type | num_prods | |
---|---|---|---|---|---|---|
Arts and crafts/Office supplies | 1 | 3 | ||||
Arts and crafts/Office supplies | body paint | body paints, markers, glitters, play cosmetics, and halloween cosmetics | 2 | 2 | ||
Arts and crafts/Office supplies | children's art and toys | 2 | 3 | |||
Arts and crafts/Office supplies | children's art and toys | bubble solution | liquid bubble solutions, including solutions for bubble machines | 3 | 1 | |
Arts and crafts/Office supplies | children's art and toys | crayons | wax crayons for coloring or illustration | 3 | 0 | |
Arts and crafts/Office supplies | children's art and toys | finger paint | non-edible finger paints | 3 | 2 | |
Arts and crafts/Office supplies | children's art and toys | play dough | children's play modeling clays | 3 | 9 | |
Arts and crafts/Office supplies | fabric treatment and dye | 2 | 7 | |||
Arts and crafts/Office supplies | fabric treatment and dye | fabric dye | products for dying fabrics | 3 | 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import numpy as np | |
def get_index_distance(index1, index2 ) : | |
home_x, home_y = index1 | |
afar_x, afar_y = index2 | |
squares = abs(home_x-afar_x)**2 + abs(home_y-afar_y)**2 | |
return math.sqrt(squares) | |
def get_closest_index(array, index) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import random | |
import requests | |
import numpy as np | |
from ssl import SSLError | |
from bs4 import BeautifulSoup | |
from bs4.element import Tag | |
from requests import ConnectionError | |
url = 'https://www.homedepot.com/sitemap/d/plp_sitemap.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import dependencies | |
import urllib2,json,arcpy | |
import numpy as np | |
import pandas as pd | |
from django.utils.encoding import smart_str | |
import time | |
################################################################################## | |
# VARIABLES | |
# set working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
here = 'path/to/htmls' | |
with open('%s/chrome.bat' % here,'w') as bat: | |
for f in os.listdir(here): | |
if f[-4:] == 'html': | |
bat.write('start chrome.exe %s/%s\n' % (here, f)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(hem) C:\Users\Rdebbout>python -m smtpd -n -c DebuggingServer localhost:1025 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fiona | |
import geopandas as gpd | |
from datetime import datetime as dt | |
def getRows(fn, lookupList, col=None): | |
reader = fiona.open(fn) | |
crs = reader.crs | |
if col == None: | |
return gpd.GeoDataFrame.from_features([reader[x] for x in lookupList],crs=crs) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
import geopandas as gpd | |
from shapely.geometry import Point | |
from rasterstats import point_query | |
from datetime import datetime as dt | |
nlcd = 'L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/LandscapeRasters/QAComplete/nlcd2006.tif' | |
pre = 'D:/NHDPlusV21/NHDPlusGL/NHDPlus04' | |
cat = gpd.read_file('%s/NHDPlusCatchment/Catchment.shp' % pre) |
NewerOlder