Analyzing gender disparity in Hollywood

What is the Bechdel test?
The Bechdel test is named after cartoonist Alison Bechdel, who introduced the idea in a comic strip in the year 1985. To pass the test, a story needs to have:
At least two women
The women need to talk to each other
They need to talk to each other about something other than a man
I first heard about the Bechdel test when watching Jane the Virgin, and it caught my interest. To me, it seemed like the standards of the test were too low, and should be ridiculously easy for movies to pass.
However, a simple Google search told me otherwise. Apparently, there were a large number of movies that did not fulfill the requirements to pass the Bechdel test, including:

#data-visualization #data-analysis #bechdel-test #gender-equality #data-science

What is GEEK

Buddha Community

Analyzing gender disparity in Hollywood

Analyzing gender disparity in Hollywood

What is the Bechdel test?
The Bechdel test is named after cartoonist Alison Bechdel, who introduced the idea in a comic strip in the year 1985. To pass the test, a story needs to have:
At least two women
The women need to talk to each other
They need to talk to each other about something other than a man
I first heard about the Bechdel test when watching Jane the Virgin, and it caught my interest. To me, it seemed like the standards of the test were too low, and should be ridiculously easy for movies to pass.
However, a simple Google search told me otherwise. Apparently, there were a large number of movies that did not fulfill the requirements to pass the Bechdel test, including:

#data-visualization #data-analysis #bechdel-test #gender-equality #data-science

Predict Gender by Name with HTML, CSS and Javascript

Learn how to create an app to predict gender by name using HTML, CSS and Javascript.

Predict Gender by Name with HTML, CSS and Javascript

In this tutorial, we take a look at how to build the project ‘Predict Gender by Name’. To build this project we need HTML, CSS, and Javascript. 

HTML:

We begin with the HTML Code. First, create a file called – ‘index.html’. Copy the code below and paste it into your HTML file.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Predict Gender By Name</title>
    <!-- Google Fonts -->
    <link
      href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap"
      rel="stylesheet"
    />
    <!-- Stylesheet -->
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <div class="container">
      <h1 class="app-title">Predict Gender By Name</h1>
      <div class="input-wrapper">
        <input
          type="text"
          value="mitali"
          id="name"
          placeholder="Enter a name.."
        />
        <button id="submit">Predict</button>
      </div>
      <div id="result">
        <div id="wrapper"></div>
        <div id="error"></div>
      </div>
    </div>
    <!-- Script -->
    <script src="script.js"></script>
  </body>
</html>

CSS:

We begin with the HTML Code. First, create a file called – ‘index.html’. Copy the code below and paste it into your HTML file.

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  background-color: #7e5eff;
}
.container {
  position: absolute;
  background-color: #ffffff;
  width: 90%;
  max-width: 31.25em;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  padding: 3em 2em;
  border-radius: 0.5em;
}
.app-title {
  font-weight: 400;
  text-transform: uppercase;
  text-align: center;
  width: 80%;
  position: relative;
  margin: auto;
  color: #020332;
  letter-spacing: 0.2em;
}
.input-wrapper {
  display: grid;
  grid-template-columns: 9fr 3fr;
  gap: 1em;
  margin: 2.5em 0;
}
#name,
#submit {
  font-size: 1em;
}
#name {
  padding: 0.8em 0.5em;
  border: 1px solid #020332;
  border-radius: 0.5em;
}
#submit {
  background-color: #7e5eff;
  color: #ffffff;
  border: none;
  border-radius: 0.5em;
}
.female {
  background-color: #ff5f96;
}
.male {
  background-color: #5a72e9;
}
#info {
  padding: 2em 1em;
  text-align: center;
  border-radius: 0.9em;
}
#result-name {
  text-transform: capitalize;
  font-weight: 500;
  color: #edecec;
}
#gender-icon {
  display: block;
  width: 5em;
  position: relative;
  margin: 2em auto 1em auto;
}
#gender {
  color: #ffffff;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
#prob {
  letter-spacing: 0.2em;
  font-weight: 500;
  color: #edecec;
}

Javascript:

Finally, we add functionality using Javascript. Once again copy the code below and paste it into your script file.

The steps included in creating this project are:

  • Variable declarations for API URL and references to HTML elements
  • The user enters a name and clicks submit, the submit button makes a call to the ‘predictGender’ function.
  • We first store the user’s input in a variable and append it to the URL
  • Then we check if the name has length>0 and if the name has alphabet only
  • If it is a valid name we use the ‘fetch’ method to make a GET request to the API
  • We get the response with the JSON data in it
  • Then we create a div where we display the name along with gender and the SVG icon for that specific gender.
let url = "https://api.genderize.io?name=";
let wrapper = document.getElementById("wrapper");
let predictGender = () => {
  let name = document.getElementById("name").value;
  let error = document.getElementById("error");
  let finalURL = url + name;
  console.log(name);
  console.log(finalURL);
  wrapper.innerHTML = "";
  error.innerHTML = "";
  //Check if input field is not empty and the entered name does not contain anything but alphabets.
  if (name.length > 0 && /^[A-Za-z]+$/.test(name)) {
    fetch(finalURL)
      .then((resp) => resp.json())
      .then((data) => {
        console.log(data);
        let div = document.createElement("div");
        div.setAttribute("id", "info");
        div.innerHTML = `<h2 id="result-name">${data.name}</h2><img src="" id="gender-icon"/> <h1 id="gender">${data.gender}</h1><h4 id="prob">Probability: ${data.probability}</h4>`;
        wrapper.append(div);
        if (data.gender == "female") {
          div.classList.add("female");
          document
            .getElementById("gender-icon")
            .setAttribute("src", "female.svg");
        } else {
          div.classList.add("male");
          document
            .getElementById("gender-icon")
            .setAttribute("src", "male.svg");
        }
      });
    document.getElementById("name").value = "";
  } else {
    error.innerHTML = "Enter a valid name with no spaces";
  }
};

document.getElementById("submit").addEventListener("click", predictGender);
window.addEventListener("load", predictGender);

Source: https://codingartistweb.com

#html #css #javascript 

Agnes  Sauer

Agnes Sauer

1597940580

She Treats, He Recruits: Analyzing Gender in Netflix’s Catalog

How I used basic NLP to look at how gender correlates to certain subjects on Netflix.

Image for post

Image for post

Image for post

A few visuals from this article. All images in this article have been visualized by the author.

A couple of years ago when I was first exposed to data science, I was amazed by a data article called “She Giggles, He Gallops” which analyzed gender in screen direction in thousands of screenplays. It specifically identified all the verbs following “he” and “she” to investigate gender tropes. Now that I’ve learned more about data science, I thought I’d try to apply a similar analysis to a different dataset.

Nowadays, streaming services have completely taken over the movie and TV industry. They’re the primary medium for viewers, and these platforms shape our culture through the movies they choose to feature. Netflix, being one of the larger streaming services, has some of the most influence in this domain, so I wanted to take a look at gender representation in its selection.

In this article, I’m going to explain the necessary intuition behind how I went about my analysis and showcase the skeleton of the code that corresponds to it. If you want to access the full code or the datasets used, you can find them on my Github repository for this project.

The Data

The third-party Netflix search engine, Flixable, released a dataset that lists all the movies and TV shows on Netflix as of 2019. It provides a couple of different attributes with the title, which include its cast and description. With these two attributes, we can look at trends in the gender(s) of the cast, and the content of the movie or TV show. For my analysis, I chose to look at the leading actor/actress’s gender.

The Flixable dataset however does not include the genders for the cast. I’m not going to label all 6000+ entries by hand, so I got some help from IMDb, which has several public datasets that are updated daily. One of these datasets details the names of actors, actresses, writers, etc. and their professions. Given the cast of a title, I found that I can match up the cast member names to the names in the IMDb dataset, see if they are labeled as an ‘actor’ or ‘actress’ and automate labeling gender that way.

#nlp #programming #netflix #data-science #gender #data analytic

Angela  Dickens

Angela Dickens

1593439277

The Gender Disparity Among Higher Academia in Computer Science

Women are underrepresented in Computer Science (CS)/ Engineering, both in the academic and professional setting. I’ve heard this many times, but I’ve always wondered how we can make this claim. Specifically, what data supports this claim and what does this data tell us about underrepresentation in these areas? In this article, I will explore and analyze the gender disparity among higher academia in computer science/engineering by answering the 3 questions below:

  • 1. Is there an equal representation of women and men in CS Faculty positions in the US?
  • 2. How has the representation of women who received doctorates in Computer & Information Science (CIS) Faculty Positions changed over time in the US?
  • 3. How has the representation of women engineers in academia changed over time in the US?

_This is part of a larger project by _[Ursatech Berkeley]

At Ursatech Berkeley, we give back to our campus community by providing pro-bono consulting services within the UC Berkeley community and lending our expertise to university-affiliated groups.

Our client’s main objectives is to uncover and mitigate the roadblocks that prevent minority groups from pursuing successful academic and professional careers in CS/Engineering. In order to assist with this goal, UrsaTech will pursue a data analysis project that involves scraping the web to amalgamate and identify patterns within university demographic data. This will help us determine how students progress through CS/Engineering programs in undergrad, graduate programs, and/or faculty positions. My focus for this project is gender.


Question 1: Is there an equal representation of women and men in CS Faculty Positions in the US?

I met a female computer scientist for the first time in college. She was my professor for my summer lab research! Prior to this, I never actually met a female engineer or computer scientist. As I continued my education, I began to notice the small number of women professors in my college’s computer science/engineering department. If my school’s department looks like this, what do the other CS departments in the US look like? Specifically, how does the representation of women CS Faculty compare to men CS Faculty in the US?

I gathered samples from 7 different CS university departments below.

Data Source:

If repeated, I would aim for a larger sample size.

Web Scrapping

I wrote the following functions below to web scrap data from MIT, Stanford, and Cal. The other schools’ data were scrapped by my fellow teammates.

I initialized the gender column to be all male and then changed it to female accordingly for each school. There may be some bias as I manually determined if the individual is a male or female based on their picture provided by the university.

from requests import get
from bs4 import BeautifulSoup
import re
import pandas as pd
import urllib.request
import numpy as np
def lst_data(website: str, tag: str, attrs_key: str, attrs_txt: str):
 response = get(website)
 html = BeautifulSoup(response.text, ‘html.parser’)
 name_data = html.find_all(tag, attrs={attrs_key: re.compile(attrs_txt)})
 return name_data
#names = [first name, last name]
def index_values(names, name_data):
 lst = []
 for name in names:
 name_str = [str(x) for x in name_data]
 new_list = [name_str.index(x) for x in name_str if re.search(name, x)]
 lst.append(new_list[0])
 return lst
#initialize all as male and change to female accordingly
def make_df(name_lst, school, female_lst):
 df = pd.DataFrame({‘Name’: name_lst, ‘School’: school, ‘Gender’: ‘male’})
 df.index = df[‘Name’]
 df.loc[female_lst, ‘Gender’] = ‘female’
 df = df.reset_index(drop=True)
 return df

The following is an example of how I scrapped faculty names from Stanford.

name_data = lst_data(‘https://cs.stanford.edu/directory/faculty', ‘a’, ‘href’, ‘^http’)

# Returns index values [8,67]. Use to index name_data
index_values([‘Maneesh Agrawala’, ‘Matei Zaharia’], name_data)
lst = []
for faculty in name_data[8:68]: 
 lst.append(faculty.text)

#female faculty names
female_lst = [‘Jeannette Bohg’, ‘Emma Brunskill’, ‘Chelsea Finn’, ‘Monica Lam’, ‘Karen Liu’, ‘Dorsa Sadigh’, \
 ‘Caroline Trippel’, ‘Jennifer Widom’, ‘Mary Wootters’]
stanford_df = make_df(lst, ‘Stanford’, female_lst)

After collecting and cleaning the appropriate data, I found the proportion of female faculty members within the CS departments of each school. The rest of the code to process the data is linked in my github at the end of the article.

#education #data-analysis #gender-equality #dáta #analysis #data analysis

Guide To Image Color Analyzer In Python

In the modern age, we store all image data in digital memory. This can be your computer or your mobile device, or your cloud space. Whenever a device stores an image, it keeps it by breaking it into a very small mosaic or pixel form or simply saying that the computer breaks it into tiny box parts before storing any image. These small box parts can be considered as the pixel of the images. Therefore, as the size of tiles increases, the resolution of the image decreases, and the fineness of the tiles increases the resolution of the images.

The simplest way to explain the pixels is that they consist of Red, Green, and Blue. Pixels are the smallest unit of information about any image, which are arranged in the 2-dimensional grid.

REGISTER FOR OUR UPCOMING ML WORKSHOP

If any of those three colours of any pixel is at full intensity, we can consider it is having a pixel value of 255. A pixel value can change between 0-255; if an image is fully red, then the RGB value is (255,0,0), where red is denoted by 255 and green and blue are 0. Below is the example where we can see the formation of a full-color image.

#developers corner #image color analyzer #opencv #opencv image processing #python #guide to image color analyzer in python