Skip to content

Instantly share code, notes, and snippets.

# SEAS_evaluations.py
# https://github.com/rasmi
import json
import urllib2
import re
from bs4 import BeautifulSoup
site_url ='http://oracle.seas.columbia.edu/'
course_list_url = site_url + 'viewcourse_m.php'
course_sections_url = site_url + 'viewresults.php?course='
@rasmi
rasmi / Heating.ipynb
Created September 18, 2016 17:15
Analyzing NYC Heating Code violations to predict future occurrences. Project by Rasmi Elasmar at HackMIT 2016.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rasmi
rasmi / yeti-setup.md
Last active December 24, 2016 23:28
Installing Python and TensorFlow on Yeti

Python Setup

Create an alias for the directory where we'll do our installation and computing.

$WORK = /vega/<group>/users/<username>

Now, install and setup the latest version of Python (2 or 3).

cd $WORK
mkdir applications
cd applications
#!/usr/bin/env python
# halo_gas_stars_dm_projections.py
# Create halo projections for gas, stars, and dm density for a given enzo directory.
# halo_projections.py RD0006
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("directory", type=str, help="List one or more directories to analyze.")
args = parser.parse_args()
directory = args.directory
#!/usr/bin/env python
# findhalos.py
# Find halos for a given enzo directory.
# findhalos.py RD0006
import yt
from yt.analysis_modules.halo_analysis.api import HaloCatalog
from yt.analysis_modules.halo_analysis.halo_filters import add_filter
directory = 'RD0009'
#!/usr/bin/env python
# halo_profiles.py
# Create halo profiles for gas, stars, and dm density for a given enzo directory.
# halo_profiles.py RD0006
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("directory", type=str, help="List one or more directories to analyze.")
args = parser.parse_args()
directory = args.directory
@rasmi
rasmi / GeorgePopulations.ipynb
Created May 2, 2016 00:02
GerogePopulations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am rasmi on github.
  • I am rasmi (https://keybase.io/rasmi) on keybase.
  • I have a public key whose fingerprint is 6224 68D7 CD9D D8A5 691A 8945 A808 3035 AEB7 46AE

To claim this, I am signing this object:

@rasmi
rasmi / README.md
Last active August 29, 2015 14:23 — forked from gisminister/README.md

The map shows traffic accidents recorded in Oslo, Norway, for the year 2013.

The Leaflet Markercluster plugin is wonderful. Since the markerclusters are divIcons you can put whatever you want inside them using the iconCreateFunction. I wanted my clusters to reveal more information than just the marker count and figured a pie chart would do the job. So I told the iconCreateFunction to do some D3 magic and this is the result.

The example is a bit more complicated than necessary due to how my dataset is structured. But if you take a look at the defineClusterIcon() function you'll see that I use d3.nest() to build a dataset for the pie chart based on a given property from all the cluster's children. Then I pass this dataset over to the bakeThePie() function together with instructions on how to style the chart. The function returns svg markup which in turn is placed inside the divIcon.

Feel free to suggest improvements.