Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
female_mask = np.array(Image.open(os.path.join(os.getcwd(), "female_mask.jpg"))) | |
male_mask = np.array(Image.open(os.path.join(os.getcwd(), "male_mask.jpg"))) | |
female_wordcloud = WordCloud(background_color="white", max_words=1000, mask=female_mask, margin=10,random_state=1).generate(female_text) | |
male_wordcloud = WordCloud(background_color="white", max_words=1000, mask=male_mask, margin=10,random_state=1).generate(male_text) | |
f, (ax1, ax2) = plt.subplots(1, 2, sharex=True) | |
f.set_size_inches(18, 20.0) | |
ax1.imshow(male_wordcloud, interpolation="bilinear") | |
ax1.set_title('Male Wordcloud', fontsize=36) |
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
cachedStopWords = stopwords.words("english") | |
punct = set(string.punctuation) | |
female_text = ' '.join(female_titles) | |
male_text = ' '.join(male_titles) | |
female_text = ''.join(ch for ch in female_text if ch not in punct) | |
male_text = ''.join(ch for ch in male_text if ch not in punct) | |
female_text = ' '.join([word for word in female_text.split() if word not in cachedStopWords]) |
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
census_surnames = pd.read_csv('app_c.csv') | |
census_firstnames = pd.read_csv('census-derived-all-first.csv') | |
firsts_lower = [str(name).lower() for name in list(census_firstnames.name)] | |
lasts_lower = [str(name).lower() for name in list(census_surnames.name)] | |
d = gender.Detector() | |
male_titles = [] | |
female_titles = [] |
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
playlist[21].title |
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
plurl = "https://www.youtube.com/playlist?list=UUi7GJNg51C3jgmYTUwqoUXA" | |
playlist = pafy.get_playlist2(plurl) | |
playlist |
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 pafy | |
import pandas as pd | |
import numpy as np | |
from PIL import Image | |
import os | |
import gender_guesser.detector as gender | |
from wordcloud import WordCloud | |
from nltk.corpus import stopwords | |
import matplotlib.pyplot as plt | |
from tqdm import tqdm |
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
#!/bin/bash | |
# Enter /opt folder (common folder for user installed programs) | |
# This script assumes you have proper permissions on /opt | |
cd /opt | |
# Download GitKraken | |
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz | |
# Extract the Kraken into /opt directory |