Skip to content

Instantly share code, notes, and snippets.

View soedr's full-sized avatar

Martin Soderstrom soedr

  • Philadelphia, PA
View GitHub Profile
@soedr
soedr / install_anaconda.md
Created June 25, 2019 20:57 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_65.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose Anaconda3-5.2.0-Linux-x86_64.sh.
  4. From the terminal run wget https://repo.continuum.io/archive/[YOUR VERSION]. Example: $ wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
  5. Run the installation script: $ bash Anaconda[YOUR VERSION].sh ($ bash Anaconda3-5.2.0-Linux-x86_64.sh)
  6. Read the license
@soedr
soedr / assignment_problem.R
Created March 28, 2018 12:08 — forked from JasonAizkalns/assignment_problem.R
Assignment Problem in R - Deterministic vs. Stochastic
library(tidyverse)
library(Rglpk)
library(glue)
df <- read_csv("data_assignment_regular.csv")
df_with_variability <- read_csv("data_assignment_with_variability.csv")
# Helper Functions ####
SolverLP <- function(model, method = "CPLEX_LP", decimal = 0) {
model1.lp <- Rglpk_read_file(model, type = method, verbose = F)
@soedr
soedr / report-runner.py
Created July 8, 2017 08:18 — forked from chris1610/report-runner.py
Pandas Pivot Table Reporting Example - pbpython.com
# -*- coding: utf-8 -*-
"""
Sample report generation script from pbpython.com
This program takes an input Excel file, reads it and turns it into a
pivot table.
The output is saved in multiple tabs in a new Excel file.
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
df = pd.read_csv(
'https://gist.githubusercontent.com/chriddyp/'
@soedr
soedr / Spark+ipython_on_MacOS.md
Created December 14, 2016 20:49 — forked from ololobus/Spark+ipython_on_MacOS.md
Apache Spark installation + ipython notebook integration guide for Mac OS X

Apache Spark installation + ipython notebook integration guide for Mac OS X

Tested with Apache Spark 1.3.1, Python 2.7.9 and Java 1.8.0_45 + workaround for Spark 1.4.x from @enahwe.

Install Java Development Kit

Download and install it from oracle.com

@soedr
soedr / app.R
Created December 6, 2016 05:59 — forked from JohnYagecic/app.R
SolarMC
# A shiny app for estimating the growth of electrical generation over a 100 year time period
# resulting from a one-time investment with reinvestment of proceeds under uncertainty.
# Programmed by John Yagecic in December 2016
# JYagecic@gmail.com
library(shiny)
library(ggplot2)
ui<-fluidPage(
@soedr
soedr / benchmarkPerformance.R
Created November 21, 2016 20:14 — forked from kvnkuang/benchmarkPerformance.R
Benchmark the performance of pbapply and pbmcapply.
library(data.table)
library(pbapply)
library(pbmcapply)
timeConsumedPbapply <- data.table()
timeConsumedPbmcapply <- data.table()
timeConsumedapply <- data.table()
numCores <- 4L
repeats <- 50
maxNum <- 10