Skip to content

Instantly share code, notes, and snippets.

Ravi Shekhar r-shekhar

Block or report user

Report or block r-shekhar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@r-shekhar
r-shekhar / assign.py
Created Jun 1, 2017
Assign Taxi Zones Snippet
View assign.py
def assign_taxi_zones(df, lon_var, lat_var, locid_var):
"""Joins DataFrame with Taxi Zones shapefile.
This function takes longitude values provided by `lon_var`, and latitude
values provided by `lat_var` in DataFrame `df`, and performs a spatial join
with the NYC taxi_zones shapefile.
The shapefile is hard coded in, as this function makes a hard assumption of
latitude and longitude coordinates. It also assumes latitude=0 and
longitude=0 is not a datapoint that can exist in your dataset. Which is
reasonable for a dataset of New York, but bad for a global dataset.
Only rows where `df.lon_var`, `df.lat_var` are reasonably near New York,
@r-shekhar
r-shekhar / commands.sh
Created Apr 14, 2017
Conda setup for Dask
View commands.sh
#!/bin/bash
sudo apt update && sudo apt upgrade -y
sudo apt install s3cmd awscli -y
wget https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh
bash Miniconda*sh -b -p ${HOME}/miniconda3
echo "export PATH=${HOME}/miniconda3/bin:${PATH}" >> ~/.bashrc
export PATH=${HOME}/miniconda3/bin:${PATH}
conda install -c conda-forge geopandas python-snappy dask distributed \
fastparquet fiona numba boto3 jupyter seaborn -y
View .zshrc
##############################################################################
#super duper shell wildcards. Makes zsh worth using
setopt extendedglob
##############################################################################
#keep history file between sessions
HISTSIZE=1000000
SAVEHIST=1000000
HISTFILE=$HOME/.history
setopt APPEND_HISTORY
You can’t perform that action at this time.