Skip to content

Instantly share code, notes, and snippets.


Monica P monipip3

View GitHub Profile
monipip3 / bls_gov.R
Created Oct 28, 2019
Webscraping all the Bureau Labor Stats tables and joining them into an R data frame
View bls_gov.R
if(!file.exists("./data/labor_data")) {dir.create("./data/labor_data")}
#save url into a variable
url <- ""
# -*- 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
monipip3 / international_womens_day.txt
Created Mar 7, 2019
Events in DC for International Womens Day
View international_womens_day.txt
Some events in DC for celebrating Women’s International Day tomorrow & this weekend (tomorrow morning breakfast) (tomorrow happy hour) (art tomorrow / weekend ) (tomorrow happy hour)
import pandas as pd
import nltk
from nltk.corpus import stopwords
from collections import OrderedDict
from nltk.tokenize import RegexpTokenizer'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
room = "clean"
def clean_room(room):
Tells the user an outcome, given the state of the room.
variable: str(state of the room)
Returns: str(outcome of the situation)
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 = ['']
creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)
client = gspread.authorize(creds)
monipip3 /
Created Jan 9, 2018
PBJ sandwich using a while loop
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
monipip3 /
Last active Jan 9, 2018
Peanut Butter and Jelly Sandwich with if and else
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)
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)
You can’t perform that action at this time.