This file contains 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
library(purrr) | |
setwd("~/Desktop") | |
library(rvest) | |
if(!file.exists("./data/labor_data")) {dir.create("./data/labor_data")} | |
suppressPackageStartupMessages(library(lubridate)) | |
suppressPackageStartupMessages(library(rvest)) | |
#save url into a variable | |
url <- "https://www.bls.gov/lau/#tables" |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Aug 1 11:28:12 2019 | |
@author: mpuerto | |
""" | |
#This file will read a CSV, understsand your data types, to then create a SQL create table statement and populate it via your S3 file | |
import csv, ast, psycopg2, os |
This file contains 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
Some events in DC for celebrating Women’s International Day tomorrow & this weekend | |
https://www.internationalwomensday.com/Activity/13460/General-Assembly-Women-in-Tech-Breakfast-Building-Inclusive-Teams-for-Success (tomorrow morning breakfast) | |
https://www.internationalwomensday.com/Activity/13758/Women-s-Day-Happy-Hour (tomorrow happy hour) | |
https://www.internationalwomensday.com/Activity/13445/Women-in-the-Arts-Pop-up-2019 (art tomorrow / weekend ) | |
https://www.internationalwomensday.com/Activity/14009/Roaring-20s-Meet-Up (tomorrow happy hour) |
This file contains 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 pandas as pd | |
import nltk | |
from nltk.corpus import stopwords | |
from collections import OrderedDict | |
from nltk.tokenize import RegexpTokenizer | |
nltk.download('stopwords') | |
df = pd.read_csv('5StarReviews.csv') | |
#crear una función llamada bigrams que saca "bigrams" utilizando las funciónes de NLTK para extraer las pares de palabras mas mencionadas |
This file contains 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
room = "clean" | |
def clean_room(room): | |
""" | |
Tells the user an outcome, given the state of the room. | |
Args: | |
variable: str(state of the room) | |
Returns: str(outcome of the situation) | |
""" |
This file contains 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 gspread | |
from oauth2client.service_account import ServiceAccountCredentials | |
import pandas as pd | |
# use creds to create a client to interact with the Google Drive API | |
scope = ['https://spreadsheets.google.com/feeds'] | |
creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope) | |
client = gspread.authorize(creds) | |
This file contains 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
bread = 12 | |
peanut_butter = 10 | |
jelly = 14 | |
i = min(bread/2, peanut_butter, jelly) | |
while i > 0: | |
print "I can make {0} sandwiches".format(i) | |
bread = bread - 2 | |
jelly = jelly - 1 | |
peanut_butter = peanut_butter - 1 | |
i = i -1 |
This file contains 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
bread = 10 | |
peanut_butter = 20 | |
jelly = 30 | |
if bread > 1 and peanut_butter >= 1 and jelly >= 1: | |
sandwiches = bread/2 | |
print "I can make {0} PBJ sandwiches today.".format(sandwiches) | |
elif bread % 2 and peanut_butter >=1 and jelly >= 1: | |
print "I can make an open face sandwich" | |
elif bread > 1 and peanut_butter >= 1 and jelly == 0: | |
bpsandwiches = min(bread/2,peanut_butter) |
This file contains 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
for bottles in range (1,100): | |
print "{0} bottles of beer on the wall, {0} bottles of beer... \n If one of those bottles should happen to fall, {1} bottles of beer on the wall".format(100 - bottles, 99 - bottles) | |