PIMCO Quantitative Research
Steve Sapra, Ph.D., CFA and Manny Hunjan, CFA
October 2013
This file contains hidden or 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
| --- | |
| name: ggplotly | |
| layout: post | |
| title: Make your ggplots shareable, collaborative, and with D3 | |
| date: 2014-04-17 | |
| author: Matt Sundquist | |
| authorurl: https://plot.ly/team | |
| tags: | |
| - R | |
| - API |
This file contains hidden or 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
| #include <iostream> | |
| #include <algorithm> | |
| #include <vector> | |
| using namespace std; | |
| int main() | |
| { | |
| // The user would introduce different values for divisor | |
| int divisor = 3; | |
| vector<int> numbers { 1, 2, 3, 4, 5, 10, 15, 20, 25, 35, 45, 50 }; |
This file contains hidden or 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
| # load the package and data set "Teams" | |
| install.packages("Lahman") | |
| library("Lahman") | |
| data(Teams) | |
| # | |
| # | |
| # CREATE LEAGUE SUMMARY TABLES | |
| # ============================ | |
| # | |
| # select a sub-set of teams from 1901 [the establishment of the American League] forward to 2012 |
This file contains hidden or 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 sys | |
| import json | |
| def hw(): | |
| print 'Hello, world!' | |
| def lines(fp): | |
| print str(len(fp.readlines())) | |
| def main(): |
This file contains hidden or 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
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python | |
| env/ |
This file contains hidden or 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
| # Using airquality dataset | |
| data <- airquality | |
| data[4:10,3] <- rep(NA,7) | |
| data[1:5,4] <- NA | |
| # Removing categorical variables | |
| data <- airquality[-c(5,6)] | |
| summary(data) | |
| #------------------------------------------------------------------------------- |
This file contains hidden or 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 requests | |
| import csv | |
| import sys | |
| # get me all active players | |
| url_allPlayers = ("http://stats.nba.com/stats/commonallplayers?IsOnlyCurrentSeason" | |
| "=0&LeagueID=00&Season=2015-16") | |
| #request url and parse the JSON |