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
df_interesting_token_sentiment_counts = pd.DataFrame( | |
{ "token": [ "bug", "bug", "construction", "construction", "deposit", "deposit", | |
"elevator", "elevator", "expensive", "expensive", "gym", "gym", "internet", | |
"internet", "laundry", "laundry", "leak", "leak", "maintenance", "maintenance", | |
"noise", "noise", "package", "package", "parking", "parking", "pet", "pet", | |
"pool", "pool", "washer", "washer", ], | |
"sentiment": [ "Negative", "Positive", "Negative", "Positive", "Negative", | |
"Positive", "Negative", "Positive", "Negative", "Positive", "Negative", | |
"Positive", "Negative", "Positive", "Negative", "Positive", "Negative", | |
"Positive", "Negative", "Positive", "Negative", "Positive", "Negative", |
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
df_campus_positive_keywords = pd.DataFrame({'campus': ['BYU', 'BYU', 'BYU', 'PSU', 'PSU', 'PSU', 'UIUC', 'UIUC', 'UIUC'], | |
'token': ['gym', 'pet', 'pool', 'gym', 'pet', 'pool', 'gym', 'pet', 'pool'], | |
'unique_frequency': [191, 35, 526, 259, 83, 263, 251, 57, 191], | |
'num_reviews': [5085, 5085, 5085, 4481, 4481, 4481, 5315, 5315, 5315], | |
'percentage': [0.0375614552605703, | |
0.00688298918387414, | |
0.10344149459193706, | |
0.05779959830395001, | |
0.018522651193929925, | |
0.0586922561928141, |
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
# install.packages("topicmodels") | |
# install.packages("reshape2") | |
# install.packages("LDAvis") | |
# install.packages("servr") | |
library(topicmodels) | |
library(reshape2) | |
library(LDAvis) | |
library(servr) |
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
mcc_list = c('STEAMSHIP LINES/CRUISE LINES', | |
'TELEGRAPH SERVICES', | |
'WIRE TRANSFER - MONEY ORDERS', | |
'DUTY FREE STORES', | |
'COCKTAIL LOUNGES, BARS - ALCOHOLIC BEVERAGES', | |
'DIGITAL GOODS MEDIA: BOOKS, MOVIES, MUSIC', | |
'DIGITAL GOODS: GAMES', | |
'PACKAGE STORES - BEER, WINE, AND LIQUOR', | |
'PAWN SHOPS', | |
'DIRECT MARKETING INSURANCE SERVICES', |
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 glob | |
import nbformat | |
from nbconvert.preprocessors import ExecutePreprocessor, CellExecutionError | |
fpaths = glob.glob('pcard-submissions/*.ipynb') | |
for fpath in fpaths: | |
print(f'Running {fpath}') | |
nb = nbformat.read(fpath, as_version=4) |
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
"[{"id":"17","fontColor":"#f9ffad","bgColor":"#c45c3c"},{"id":"56","fontColor":"#0b93bc","bgColor":"#99cce5"},{"id":"57","fontColor":"#733ea8","bgColor":"#8250c9"},{"id":"61","fontColor":"#600f96","bgColor":"#e4a3ff"},{"id":"63","fontColor":"#037772","bgColor":"#c9fdff"},{"id":"64","fontColor":"#fc85c7","bgColor":"#400875"},{"id":"67","fontColor":"#f9f4a9","bgColor":"#16c4f4"},{"id":"69","fontColor":"#fff5ba","bgColor":"#db6e34"},{"id":"70","fontColor":"#da9bff","bgColor":"#71299e"},{"id":"71","fontColor":"#63b512","bgColor":"#bbfc85"},{"id":"73","fontColor":"#fc5fdd","bgColor":"#42097a"},{"id":"75","fontColor":"#1abc6b","bgColor":"#d5f943"},{"id":"78","fontColor":"#fff5af","bgColor":"#00cc44"},{"id":"79","fontColor":"#b6e866","bgColor":"#8dad24"},{"id":"81","fontColor":"#081063","bgColor":"#40e8e2"},{"id":"84","fontColor":"#ce5c46","bgColor":"#f7ce9b"},{"id":"85","fontColor":"#ffffbc","bgColor":"#d6753e"},{"id":"86","fontColor":"#ceef5f","bgColor":"#87b509"},{"id":"87","fontColor":"#03a853","bgColor":"#adf7a |
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
function addTwoNumbers(num1, num2) { | |
return num1 + num2; | |
} | |
var result = addTwoNumbers('10', 20); | |
console.log("Result: " + result); | |
console.log("Return Type: " + typeof result); | |
// Outputs an error message during compilation | |
// demo.ts(5,28): error TS2345: Argument of type '"10"' is not assignable to parameter of type 'number'. |
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
function addTwoNumbers(num1, num2) { | |
return num1 + num2; | |
} | |
let result = addTwoNumbers('10', 20); | |
console.log(`Result: ${result}`); | |
console.log(`Return Type: ${typeof result}`); |
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
function getScreenshot() { | |
// Get html for doodle | |
var shadowDoodle = document.querySelector('css-doodle').shadowRoot, | |
mainDoodle = shadowDoodle.innerHTML, | |
introDoodle = $('css-doodle').prop('outerHTML').replace(/\s\s+/g, ' '), | |
dataDoodle = introDoodle + mainDoodle; | |
// Create a form on the fly and submit it to screenshot generator server | |
var doodleForm = document.createElement('form'); | |
var doodleTitleInput = document.createElement('input'); |
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
def rgb_to_hsl_arr(image_data): | |
return np.apply_along_axis(rgb_to_hsl, -1, image_data) | |
def hsl_to_rgb_arr(image_data): | |
return np.apply_along_axis(hsl_to_rgb, -1, image_data) | |
def rgb_to_hsl(rgb_as_float): | |
r, g, b = rgb_as_float | |
high = max(r, g, b) | |
low = min(r, g, b) |
NewerOlder