Skip to content

Instantly share code, notes, and snippets.

@rahul-c1
rahul-c1 / readme.md
Created March 25, 2017 20:53 — forked from cosmincatalin/install-rstudio-server.sh
AWS EMR bootstrap to install RStudio Server along with sparklyr

AWS EMR bootstrap to install RStudio Server along with sparklyr

How to use the bootstrap

  1. You will first have to download the gist to a file and then upload it to S3 in a bucket of your choice.
  2. Using the AWS EMR Console create a cluster and choose advanced options.
  3. In Step 1 make sure you check the Spark x.x.x checkbox if you want to make use of the sparklyr library in RStudio. You can customize the Spark version by choosing a different emr Release version.
  4. In Step 3 you can configure your bootstraps. Choose to Configure and add a Custom action
    • For the Name you can fill something like Install RStudio Server
    • For the Script location you will need to point to where you have uploaded the gist (Eg. s3://my-bucket/emr/bootstrap/install-rstudio-server.sh)
@rahul-c1
rahul-c1 / readme.md
Created March 25, 2017 20:53 — forked from cosmincatalin/install-rstudio-server.sh
AWS EMR bootstrap to install RStudio Server along with sparklyr

AWS EMR bootstrap to install RStudio Server along with sparklyr

How to use the bootstrap

  1. You will first have to download the gist to a file and then upload it to S3 in a bucket of your choice.
  2. Using the AWS EMR Console create a cluster and choose advanced options.
  3. In Step 1 make sure you check the Spark x.x.x checkbox if you want to make use of the sparklyr library in RStudio. You can customize the Spark version by choosing a different emr Release version.
  4. In Step 3 you can configure your bootstraps. Choose to Configure and add a Custom action
    • For the Name you can fill something like Install RStudio Server
    • For the Script location you will need to point to where you have uploaded the gist (Eg. s3://my-bucket/emr/bootstrap/install-rstudio-server.sh)
import pandas as pd
import numpy as np
import re
# ================================================
class option_parser:
def __init__(self, symbol, response):
self.symbol = symbol
self.response = response
# ------------------------------------------------
import pandas as pd
import numpy as np
import re
# ================================================
class option_parser:
def __init__(self, symbol, response):
self.symbol = symbol
self.response = response
# ------------------------------------------------
import asyncio
import aiohttp
# ================================================
# for first run only
class first_async_scraper:
def __init__(self):
pass
async def _fetch(self, symbol, url, session, headers):
import os
import sys
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import time
import asyncio
from fake_useragent import UserAgent
'''set path variables'''
project_dir = "YOUR/PROJECT/DIR"
@rahul-c1
rahul-c1 / NFL QB Analysis_Wins vs TD_Int Ratio.ipynb
Created July 23, 2017 20:28 — forked from BlackArbsCEO/NFL QB Analysis_Wins vs TD_Int Ratio.ipynb
Simple Linear Regression comparing NFL Quarterback Win Percentage vs. Touchdown to Interception ratio using data collected from Pro-football-reference.com
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
'''
Netfonds import 5 days of intraday data
'''
import numpy as np
import pandas as p
from pandas.tseries.offsets import *
import datetime as dt
import matplotlib.pyplot as plt
size = (14,10)
@rahul-c1
rahul-c1 / scp.md
Created July 25, 2017 14:35 — forked from michaelminter/scp.md
scp examples # command line, linux, mac

#Example syntax for Secure Copy (scp)

##What is Secure Copy?

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

###Examples

Copy the file "foobar.txt" from a remote host to the local host

@rahul-c1
rahul-c1 / foundational-data-science.md
Created September 26, 2017 20:01 — forked from csgillespie/foundational-data-science.md
Foundational data science with R

Software

Please make sure you are using the latest version of R (current version is 3.4.1) - the final digit is the minor version number. The essential numbers are the first two. You can check the version of R you are running via

R.version.string

Please install the latest version of RStudio (https://www.rstudio.com/products/rstudio/download/).