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 | |
import json | |
import pandas as pd | |
import psycopg2 | |
from sqlalchemy import create_engine | |
# Client | |
class Client: | |
# Create a global psql connection object | |
def __init__(self, user, password, database, host): | |
self.user = user |
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
javascript:const params = new URLSearchParams(window.location.search); params.set("_sabdlo", "1"); params.set("LH_Auction","1"); params.set("_ex_kw","sponsored"); params.set("LH_NOB", "1"); window.location.href=window.location.origin+window.location.pathname+"?"+params.toString(); | |
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
# Given a list of numbers, figure out how many have an even number of digits | |
import math | |
def numDigits(num): | |
digits = math.floor(math.log10(num))+1 | |
return(digits) |
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 packages | |
import requests | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
df = pd.DataFrame(columns=['License Type', 'Name', 'Main Address*', 'Mailing Address', | |
'Name Type', 'License Number', 'Rank', 'Status', 'Expires']) | |
#For loop through 103 pages | |
for page in range(1, 104): |
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
amount,assetid,subtypeid,pile,rareflag,rating,weightrare,year,resourceid,bronze,silver,gold,class,category,level,type | |
0,7,201,7,0,50,0,2017,5001001,8,2,1,Player,Contract,Bronze,Non-Rare | |
0,7,201,7,0,65,0,2017,5001002,10,10,8,Player,Contract,Silver,Non-Rare | |
0,7,201,7,0,80,0,2017,5001003,15,11,13,Player,Contract,Gold,Non-Rare | |
0,7,201,7,1,60,100,2017,5001004,15,6,3,Player,Contract,Bronze,Rare | |
0,7,201,7,1,70,100,2017,5001005,20,24,18,Player,Contract,Silver,Rare | |
0,7,201,7,1,90,100,2017,5001006,28,24,28,Player,Contract,Gold,Rare | |
0,8,202,7,0,50,0,2017,5001007,8,2,1,Manager,Contract,Bronze,Non-Rare | |
0,8,202,7,0,65,0,2017,5001008,8,10,8,Manager,Contract,Silver,Non-Rare | |
0,8,202,7,0,80,0,2017,5001009,11,11,13,Manager,Contract,Gold,Non-Rare |
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 1.
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
cardInfo = pd.read_csv("""amount,assetid,subtypeid,pile,rareflag,rating,weightrare,year,resourceid,bronze,silver,gold,class,category,level,type | |
0,7,201,7,0,50,0,2017,5001001,8,2,1,Player,Contract,Bronze,Non-Rare | |
0,7,201,7,0,65,0,2017,5001002,10,10,8,Player,Contract,Silver,Non-Rare | |
0,7,201,7,0,80,0,2017,5001003,15,11,13,Player,Contract,Gold,Non-Rare | |
0,7,201,7,1,60,100,2017,5001004,15,6,3,Player,Contract,Bronze,Rare | |
0,7,201,7,1,70,100,2017,5001005,20,24,18,Player,Contract,Silver,Rare | |
0,7,201,7,1,90,100,2017,5001006,28,24,28,Player,Contract,Gold,Rare | |
0,8,202,7,0,50,0,2017,5001007,8,2,1,Manager,Contract,Bronze,Non-Rare | |
0,8,202,7,0,65,0,2017,5001008,8,10,8,Manager,Contract,Silver,Non-Rare | |
0,8,202,7,0,80,0,2017,5001009,11,11,13,Manager,Contract,Gold,Non-Rare |
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
remove_outliers <- function(x, na.rm = TRUE, ...) { | |
qnt <- quantile(x, probs=c(.25, .75), na.rm = na.rm, ...) | |
H <- 1.5 * IQR(x, na.rm = na.rm) | |
y <- x | |
y[x < (qnt[1] - H)] <- NA | |
y[x > (qnt[2] + H)] <- NA | |
y | |
} |
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
// Program to find the greatest common divisor of two nonnegative integer values | |
#include <stdio.h> | |
int main (void) | |
{ | |
int u, v, temp; | |
printf ("Please type in two nonnegative integers.\n"); | |
scanf ("%i%i", &u, &v); | |