- sudo -i : elevate to super user
- du : get breakdown of memory usage of all subdirectories
- df -h : get breakdown of memory usage on disk
- ls -a : show all files in directory (including hidden files)
- rsync : copy files from one server to another (similar to scp but more functionality)
- Set up rsync with sudo
- rsync -az -e "ssh" --rsync-path="sudo rsync" user@servername:/pulled-source-directory /local-directory/
- rsync [source] [destination]
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
(?<!@|#)\b\w+ : Remove all words starting with @ or # (remove hashtags and user handles from twitter) | |
(?<!@|#)\b\w{2,} : Same as above but only keep words with length of 2 or greater |
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
# the following script will import Philadelphia Crime Data | |
# Parts I and II, create a summary based on year, month, and crime type | |
# and will create a basic map in leaflet using the first 1000 incidents | |
# you will need to install dplyr, leaflet, readr, lubridate, and stringr | |
# packages ( install.packages('package name') ) | |
rm(list = ls()) | |
library(dplyr) | |
library(leaflet) | |
library(readr) |
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
# code for streaming twitter to a mysql db | |
# for Python 3 and will support emoji characters (utf8mb4) | |
# based on the Python 2 code | |
# supplied by http://pythonprogramming.net/twitter-api-streaming-tweets-python-tutorial/ | |
# for further information on how to use python 3, twitter's api, and | |
# mysql together visit: http://miningthedetails.com/blog/python/TwitterStreamsPythonMySQL/ | |
from tweepy import Stream | |
from tweepy import OAuthHandler |
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
s = ['c' ,'is', 'equal', 'to', 'b'] | |
print(s) | |
# output >> ['c', 'is', 'equal', 'to', 'b'] | |
# dictionary of names:values | |
d = {'joe':['a', 'b'], 'tom':['c', 'd']} | |
# replace any values from the dict with the key value | |
for i in range(0, len(s)): | |
for key,value in d.items(): | |
for v in value: |
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 Libraries ############################################## | |
# if you don't have the libraries below you can install the library using the | |
# following command : install.packages('package_name_here_in_quotes') | |
library(dplyr) | |
library(lubridate) | |
library(RColorBrewer) | |
library(leaflet) | |
library(stringr) | |
library(rgdal) |
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
#################################################### | |
# case of global assignment | |
# parent environment is the global environment | |
# from Hadley Wickham's 'Advanced R' | |
##################################################### | |
x <- 0 | |
f <- function() { | |
x <<- 1 | |
} |
conda info --envs
: lists all environmentssource activate <env name>
: activate an environmentsource deactivate
: deactivate an environmentconda list
: list all packages installedconda create --name <env name> python=3 astroid babel
: create new environment, specify version of python, and install packages- WINDOWS NOTE: SOURCE is not recognized. When deactivating and activating in the anaconda command prompt, skip
source
and just typedeactivate
oractivate
depending on what you are trying to do. conda env export > environment.yml
: export conda environment requirements list to a fileconda env remove -n ENV_NAME
: delete environment
- CDC WONDER
- mortality data
- birth data
- environment
- population data
- Pennsylvania State Data Center
- County level data (mostly census data) for PA
- Census Data
- County Adjacency: County adjacency data from the US census bureau
- County Health Rankings
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
license: gpl-3.0 | |
height: 500 | |
scrolling: no | |
border: no |
OlderNewer