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
| # This Python program quickly measures the polarity and subjectivity of a piece of text. | |
| from time import sleep | |
| from textblob import TextBlob | |
| def print_header(): | |
| print("*"*67) | |
| print("PYTHON SENTIMENT TESTER (Powered by TextBlob)") | |
| print() | |
| print("POLARITY:") |
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
| # Step 1: Set up a Google form that collects First Name, Last Name, and Email Address from participants | |
| # Step 2: Once all participants have completed the form, export it as a CSV file and store it in the same directory as this program | |
| # Step 3: Run the program to create random Secret Santa gift-giving assignments so that each participant is paired with a different participant without duplication or anyone being left out | |
| import csv | |
| import datetime | |
| import random | |
| def main(): | |
| participants = get_participants_from_csv("test_file.csv") |
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
| # Corresponding CSV files exported from local SQL Engine. | |
| import csv | |
| from collections import Counter | |
| import matplotlib.pyplot as plt | |
| grades_102 = [] | |
| grades_201 = [] | |
| grades_206 = [] | |
| grades_207 = [] |
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 csv | |
| import calendar | |
| from collections import Counter | |
| import matplotlib.pyplot as plt | |
| # set up empty Counter objectS | |
| months_counter = Counter() | |
| # open and read CSV | |
| with open("dashboard-export.csv") as f: |
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 re | |
| from collections import Counter | |
| def main(): | |
| print_header() | |
| user_file = input("Enter the absolute path for your TXT file:\n\n") | |
| print() | |
| wc = get_word_counter(user_file) | |
| print() | |
| get_count_of_word(wc) |
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 csv | |
| import sys | |
| from collections import Counter, defaultdict | |
| from datetime import datetime as dt | |
| from decimal import Decimal | |
| from time import sleep | |
| # First import your purchases data from Amazon.com and store CSV | |
| # file in the same directory as this program. | |
| # Column names in CSV file for reference |
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
| # Auburn, WA Police Data CSV available at: https://data.auburnwa.gov/ | |
| import csv | |
| import sys | |
| from collections import Counter | |
| # CSV headers for reference | |
| # [0] CASENUMBER | |
| # [1] OFFENSE | |
| # [2] OFFENSETYPE |
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
| # Auburn, WA Police Data CSV available at: https://data.auburnwa.gov/ | |
| import csv | |
| import sys | |
| from collections import Counter | |
| from datetime import datetime as dt | |
| # Rows in CSV file for reference: | |
| # [0] CASENUMBER | |
| # [1] OFFENSE |
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 random | |
| import smtplib | |
| import ssl | |
| import sys | |
| import textwrap | |
| from email.mime.text import MIMEText | |
| from datetime import datetime | |
| def main(): | |
| print_header() |
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 | |
| from string import punctuation | |
| import json | |
| from nltk.corpus import cmudict | |
| # load dict of words in corpus but not in cmudict | |
| with open("missing_words.json") as f: | |
| missing_words = json.load(f) | |
| cmudict = cmudict.dict() |