Skip to content

Instantly share code, notes, and snippets.

@martymcguire
Last active April 23, 2018 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martymcguire/27a871efafde559008845f705d3bf27a to your computer and use it in GitHub Desktop.
Save martymcguire/27a871efafde559008845f705d3bf27a to your computer and use it in GitHub Desktop.
Loading dataset WWW18
license: mit
action perceived_type_of_assault gender_of_respondent age_group value
sexual comments about a woman/girl’s body parts or appearance sexual harassment female 15-19 20
sexual comments about a woman/girl’s body parts or appearance sexual harassment female 20-29 26
sexual comments about a woman/girl’s body parts or appearance sexual harassment female 30-49 16
sexual comments about a woman/girl’s body parts or appearance sexual harassment female 50 12
sexual comments about a woman/girl’s body parts or appearance sexual harassment male 15-19 8
sexual comments about a woman/girl’s body parts or appearance sexual harassment male 20-29 6
sexual comments about a woman/girl’s body parts or appearance sexual harassment male 30-49 2
sexual comments about a woman/girl’s body parts or appearance sexual harassment male 50 4
sexual comments about a woman/girl’s body parts or appearance sexual violence female 15-19 1
sexual comments about a woman/girl’s body parts or appearance sexual violence female 20-29 1
sexual comments about a woman/girl’s body parts or appearance sexual violence female 30-49 2
sexual comments about a woman/girl’s body parts or appearance sexual violence female 50 1
sexual comments about a woman/girl’s body parts or appearance sexual violence male 15-19 0
sexual comments about a woman/girl’s body parts or appearance sexual violence male 20-29 0
sexual comments about a woman/girl’s body parts or appearance sexual violence male 30-49 0
sexual comments about a woman/girl’s body parts or appearance sexual violence male 50 0
sexual comments about a woman/girl’s body parts or appearance don’t know female 15-19 6
sexual comments about a woman/girl’s body parts or appearance don’t know female 20-29 0
sexual comments about a woman/girl’s body parts or appearance don’t know female 30-49 5
sexual comments about a woman/girl’s body parts or appearance don’t know female 50 2
sexual comments about a woman/girl’s body parts or appearance don’t know male 15-19 0
sexual comments about a woman/girl’s body parts or appearance don’t know male 20-29 2
sexual comments about a woman/girl’s body parts or appearance don’t know male 30-49 0
sexual comments about a woman/girl’s body parts or appearance don’t know male 50 1
sexual comments about a woman/girl’s body parts or appearance no answer female 15-19 4
sexual comments about a woman/girl’s body parts or appearance no answer female 20-29 8
sexual comments about a woman/girl’s body parts or appearance no answer female 30-49 6
sexual comments about a woman/girl’s body parts or appearance no answer female 50 7
sexual comments about a woman/girl’s body parts or appearance no answer male 15-19 4
sexual comments about a woman/girl’s body parts or appearance no answer male 20-29 3
sexual comments about a woman/girl’s body parts or appearance no answer male 30-49 3
sexual comments about a woman/girl’s body parts or appearance no answer male 50 5
whistling while a woman or a girl is passing by sexual harassment female 15-19 21
whistling while a woman or a girl is passing by sexual harassment female 20-29 23
whistling while a woman or a girl is passing by sexual harassment female 30-49 17
whistling while a woman or a girl is passing by sexual harassment female 50 11
whistling while a woman or a girl is passing by sexual harassment male 15-19 8
whistling while a woman or a girl is passing by sexual harassment male 20-29 7
whistling while a woman or a girl is passing by sexual harassment male 30-49 2
whistling while a woman or a girl is passing by sexual harassment male 50 4
whistling while a woman or a girl is passing by sexual violence female 15-19 1
whistling while a woman or a girl is passing by sexual violence female 20-29 1
whistling while a woman or a girl is passing by sexual violence female 30-49 2
whistling while a woman or a girl is passing by sexual violence female 50 2
whistling while a woman or a girl is passing by sexual violence male 15-19 0
whistling while a woman or a girl is passing by sexual violence male 20-29 1
whistling while a woman or a girl is passing by sexual violence male 30-49 0
whistling while a woman or a girl is passing by sexual violence male 50 2
whistling while a woman or a girl is passing by don’t know female 15-19 3
whistling while a woman or a girl is passing by don’t know female 20-29 4
whistling while a woman or a girl is passing by don’t know female 30-49 3
whistling while a woman or a girl is passing by don’t know female 50 2
whistling while a woman or a girl is passing by don’t know male 15-19 0
whistling while a woman or a girl is passing by don’t know male 20-29 1
whistling while a woman or a girl is passing by don’t know male 30-49 1
whistling while a woman or a girl is passing by don’t know male 50 1
whistling while a woman or a girl is passing by no answer female 15-19 6
whistling while a woman or a girl is passing by no answer female 20-29 7
whistling while a woman or a girl is passing by no answer female 30-49 7
whistling while a woman or a girl is passing by no answer female 50 7
whistling while a woman or a girl is passing by no answer male 15-19 4
whistling while a woman or a girl is passing by no answer male 20-29 2
whistling while a woman or a girl is passing by no answer male 30-49 2
whistling while a woman or a girl is passing by no answer male 50 3
sexually suggestive staring sexual harassment female 15-19 9
sexually suggestive staring sexual harassment female 20-29 21
sexually suggestive staring sexual harassment female 30-49 14
sexually suggestive staring sexual harassment female 50 11
sexually suggestive staring sexual harassment male 15-19 4
sexually suggestive staring sexual harassment male 20-29 5
sexually suggestive staring sexual harassment male 30-49 2
sexually suggestive staring sexual harassment male 50 4
sexually suggestive staring sexual violence female 15-19 2
sexually suggestive staring sexual violence female 20-29 3
sexually suggestive staring sexual violence female 30-49 5
sexually suggestive staring sexual violence female 50 1
sexually suggestive staring sexual violence male 15-19 0
sexually suggestive staring sexual violence male 20-29 2
sexually suggestive staring sexual violence male 30-49 0
sexually suggestive staring sexual violence male 50 0
sexually suggestive staring don’t know female 15-19 2
sexually suggestive staring don’t know female 20-29 5
sexually suggestive staring don’t know female 30-49 3
sexually suggestive staring don’t know female 50 1
sexually suggestive staring don’t know male 15-19 0
sexually suggestive staring don’t know male 20-29 2
sexually suggestive staring don’t know male 30-49 1
sexually suggestive staring don’t know male 50 2
sexually suggestive staring no answer female 15-19 3
sexually suggestive staring no answer female 20-29 6
sexually suggestive staring no answer female 30-49 7
sexually suggestive staring no answer female 50 9
sexually suggestive staring no answer male 15-19 2
sexually suggestive staring no answer male 20-29 2
sexually suggestive staring no answer male 30-49 2
sexually suggestive staring no answer male 50 4
exposing one’s sexual organs at someone sexual harassment female 15-19 14
exposing one’s sexual organs at someone sexual harassment female 20-29 16
exposing one’s sexual organs at someone sexual harassment female 30-49 14
exposing one’s sexual organs at someone sexual harassment female 50 10
exposing one’s sexual organs at someone sexual harassment male 15-19 4
exposing one’s sexual organs at someone sexual harassment male 20-29 2
exposing one’s sexual organs at someone sexual harassment male 30-49 1
exposing one’s sexual organs at someone sexual harassment male 50 0
exposing one’s sexual organs at someone sexual violence female 15-19 6
exposing one’s sexual organs at someone sexual violence female 20-29 8
exposing one’s sexual organs at someone sexual violence female 30-49 4
exposing one’s sexual organs at someone sexual violence female 50 4
exposing one’s sexual organs at someone sexual violence male 15-19 3
exposing one’s sexual organs at someone sexual violence male 20-29 5
exposing one’s sexual organs at someone sexual violence male 30-49 1
exposing one’s sexual organs at someone sexual violence male 50 2
exposing one’s sexual organs at someone don’t know female 15-19 7
exposing one’s sexual organs at someone don’t know female 20-29 4
exposing one’s sexual organs at someone don’t know female 30-49 2
exposing one’s sexual organs at someone don’t know female 50 0
exposing one’s sexual organs at someone don’t know male 15-19 1
exposing one’s sexual organs at someone don’t know male 20-29 1
exposing one’s sexual organs at someone don’t know male 30-49 1
exposing one’s sexual organs at someone don’t know male 50 1
exposing one’s sexual organs at someone no answer female 15-19 4
exposing one’s sexual organs at someone no answer female 20-29 7
exposing one’s sexual organs at someone no answer female 30-49 9
exposing one’s sexual organs at someone no answer female 50 8
exposing one’s sexual organs at someone no answer male 15-19 4
exposing one’s sexual organs at someone no answer male 20-29 3
exposing one’s sexual organs at someone no answer male 30-49 2
exposing one’s sexual organs at someone no answer male 50 7
purposely brushing up against someone else on street/public transportation sexual harassment female 15-19 17
purposely brushing up against someone else on street/public transportation sexual harassment female 20-29 21
purposely brushing up against someone else on street/public transportation sexual harassment female 30-49 16
purposely brushing up against someone else on street/public transportation sexual harassment female 50 14
purposely brushing up against someone else on street/public transportation sexual harassment male 15-19 5
purposely brushing up against someone else on street/public transportation sexual harassment male 20-29 3
purposely brushing up against someone else on street/public transportation sexual harassment male 30-49 2
purposely brushing up against someone else on street/public transportation sexual harassment male 50 2
purposely brushing up against someone else on street/public transportation sexual violence female 15-19 8
purposely brushing up against someone else on street/public transportation sexual violence female 20-29 6
purposely brushing up against someone else on street/public transportation sexual violence female 30-49 3
purposely brushing up against someone else on street/public transportation sexual violence female 50 3
purposely brushing up against someone else on street/public transportation sexual violence male 15-19 3
purposely brushing up against someone else on street/public transportation sexual violence male 20-29 5
purposely brushing up against someone else on street/public transportation sexual violence male 30-49 0
purposely brushing up against someone else on street/public transportation sexual violence male 50 2
purposely brushing up against someone else on street/public transportation don’t know female 15-19 1
purposely brushing up against someone else on street/public transportation don’t know female 20-29 1
purposely brushing up against someone else on street/public transportation don’t know female 30-49 0
purposely brushing up against someone else on street/public transportation don’t know female 50 0
purposely brushing up against someone else on street/public transportation don’t know male 15-19 0
purposely brushing up against someone else on street/public transportation don’t know male 20-29 0
purposely brushing up against someone else on street/public transportation don’t know male 30-49 1
purposely brushing up against someone else on street/public transportation don’t know male 50 2
purposely brushing up against someone else on street/public transportation no answer female 15-19 5
purposely brushing up against someone else on street/public transportation no answer female 20-29 7
purposely brushing up against someone else on street/public transportation no answer female 30-49 11
purposely brushing up against someone else on street/public transportation no answer female 50 5
purposely brushing up against someone else on street/public transportation no answer male 15-19 4
purposely brushing up against someone else on street/public transportation no answer male 20-29 3
purposely brushing up against someone else on street/public transportation no answer male 30-49 1
purposely brushing up against someone else on street/public transportation no answer male 50 4
demands for sexual favors sexual harassment female 15-19 17
demands for sexual favors sexual harassment female 20-29 14
demands for sexual favors sexual harassment female 30-49 13
demands for sexual favors sexual harassment female 50 10
demands for sexual favors sexual harassment male 15-19 6
demands for sexual favors sexual harassment male 20-29 5
demands for sexual favors sexual harassment male 30-49 2
demands for sexual favors sexual harassment male 50 1
demands for sexual favors sexual violence female 15-19 6
demands for sexual favors sexual violence female 20-29 8
demands for sexual favors sexual violence female 30-49 6
demands for sexual favors sexual violence female 50 6
demands for sexual favors sexual violence male 15-19 2
demands for sexual favors sexual violence male 20-29 4
demands for sexual favors sexual violence male 30-49 0
demands for sexual favors sexual violence male 50 1
demands for sexual favors don’t know female 15-19 3
demands for sexual favors don’t know female 20-29 5
demands for sexual favors don’t know female 30-49 1
demands for sexual favors don’t know female 50 1
demands for sexual favors don’t know male 15-19 0
demands for sexual favors don’t know male 20-29 0
demands for sexual favors don’t know male 30-49 1
demands for sexual favors don’t know male 50 2
demands for sexual favors no answer female 15-19 5
demands for sexual favors no answer female 20-29 8
demands for sexual favors no answer female 30-49 10
demands for sexual favors no answer female 50 5
demands for sexual favors no answer male 15-19 4
demands for sexual favors no answer male 20-29 2
demands for sexual favors no answer male 30-49 1
demands for sexual favors no answer male 50 6
rubbing against another person in a sexual way sexual harassment female 15-19 6
rubbing against another person in a sexual way sexual harassment female 20-29 14
rubbing against another person in a sexual way sexual harassment female 30-49 11
rubbing against another person in a sexual way sexual harassment female 50 9
rubbing against another person in a sexual way sexual harassment male 15-19 3
rubbing against another person in a sexual way sexual harassment male 20-29 2
rubbing against another person in a sexual way sexual harassment male 30-49 2
rubbing against another person in a sexual way sexual harassment male 50 2
rubbing against another person in a sexual way sexual violence female 15-19 5
rubbing against another person in a sexual way sexual violence female 20-29 10
rubbing against another person in a sexual way sexual violence female 30-49 9
rubbing against another person in a sexual way sexual violence female 50 6
rubbing against another person in a sexual way sexual violence male 15-19 1
rubbing against another person in a sexual way sexual violence male 20-29 6
rubbing against another person in a sexual way sexual violence male 30-49 1
rubbing against another person in a sexual way sexual violence male 50 1
rubbing against another person in a sexual way don’t know female 15-19 0
rubbing against another person in a sexual way don’t know female 20-29 4
rubbing against another person in a sexual way don’t know female 30-49 0
rubbing against another person in a sexual way don’t know female 50 1
rubbing against another person in a sexual way don’t know male 15-19 0
rubbing against another person in a sexual way don’t know male 20-29 0
rubbing against another person in a sexual way don’t know male 30-49 1
rubbing against another person in a sexual way don’t know male 50 0
rubbing against another person in a sexual way no answer female 15-19 5
rubbing against another person in a sexual way no answer female 20-29 7
rubbing against another person in a sexual way no answer female 30-49 9
rubbing against another person in a sexual way no answer female 50 6
rubbing against another person in a sexual way no answer male 15-19 2
rubbing against another person in a sexual way no answer male 20-29 3
rubbing against another person in a sexual way no answer male 30-49 1
rubbing against another person in a sexual way no answer male 50 7
following/stalking sexual harassment female 15-19 13
following/stalking sexual harassment female 20-29 7
following/stalking sexual harassment female 30-49 6
following/stalking sexual harassment female 50 6
following/stalking sexual harassment male 15-19 3
following/stalking sexual harassment male 20-29 1
following/stalking sexual harassment male 30-49 2
following/stalking sexual harassment male 50 2
following/stalking sexual violence female 15-19 7
following/stalking sexual violence female 20-29 14
following/stalking sexual violence female 30-49 12
following/stalking sexual violence female 50 9
following/stalking sexual violence male 15-19 5
following/stalking sexual violence male 20-29 8
following/stalking sexual violence male 30-49 1
following/stalking sexual violence male 50 1
following/stalking don’t know female 15-19 5
following/stalking don’t know female 20-29 5
following/stalking don’t know female 30-49 1
following/stalking don’t know female 50 0
following/stalking don’t know male 15-19 0
following/stalking don’t know male 20-29 0
following/stalking don’t know male 30-49 1
following/stalking don’t know male 50 0
following/stalking no answer female 15-19 6
following/stalking no answer female 20-29 9
following/stalking no answer female 30-49 10
following/stalking no answer female 50 7
following/stalking no answer male 15-19 4
following/stalking no answer male 20-29 2
following/stalking no answer male 30-49 1
following/stalking no answer male 50 7
grabbing, pinching, slapping sexual harassment female 15-19 12
grabbing, pinching, slapping sexual harassment female 20-29 5
grabbing, pinching, slapping sexual harassment female 30-49 4
grabbing, pinching, slapping sexual harassment female 50 4
grabbing, pinching, slapping sexual harassment male 15-19 1
grabbing, pinching, slapping sexual harassment male 20-29 2
grabbing, pinching, slapping sexual harassment male 30-49 1
grabbing, pinching, slapping sexual harassment male 50 0
grabbing, pinching, slapping sexual violence female 15-19 10
grabbing, pinching, slapping sexual violence female 20-29 19
grabbing, pinching, slapping sexual violence female 30-49 16
grabbing, pinching, slapping sexual violence female 50 10
grabbing, pinching, slapping sexual violence male 15-19 6
grabbing, pinching, slapping sexual violence male 20-29 7
grabbing, pinching, slapping sexual violence male 30-49 2
grabbing, pinching, slapping sexual violence male 50 3
grabbing, pinching, slapping don’t know female 15-19 3
grabbing, pinching, slapping don’t know female 20-29 3
grabbing, pinching, slapping don’t know female 30-49 1
grabbing, pinching, slapping don’t know female 50 1
grabbing, pinching, slapping don’t know male 15-19 0
grabbing, pinching, slapping don’t know male 20-29 0
grabbing, pinching, slapping don’t know male 30-49 1
grabbing, pinching, slapping don’t know male 50 2
grabbing, pinching, slapping no answer female 15-19 7
grabbing, pinching, slapping no answer female 20-29 8
grabbing, pinching, slapping no answer female 30-49 8
grabbing, pinching, slapping no answer female 50 7
grabbing, pinching, slapping no answer male 15-19 4
grabbing, pinching, slapping no answer male 20-29 2
grabbing, pinching, slapping no answer male 30-49 1
grabbing, pinching, slapping no answer male 50 5
attempted rape sexual harassment female 15-19 6
attempted rape sexual harassment female 20-29 2
attempted rape sexual harassment female 30-49 1
attempted rape sexual harassment female 50 3
attempted rape sexual harassment male 15-19 2
attempted rape sexual harassment male 20-29 1
attempted rape sexual harassment male 30-49 1
attempted rape sexual harassment male 50 0
attempted rape sexual violence female 15-19 14
attempted rape sexual violence female 20-29 23
attempted rape sexual violence female 30-49 18
attempted rape sexual violence female 50 14
attempted rape sexual violence male 15-19 6
attempted rape sexual violence male 20-29 8
attempted rape sexual violence male 30-49 2
attempted rape sexual violence male 50 3
attempted rape don’t know female 15-19 3
attempted rape don’t know female 20-29 2
attempted rape don’t know female 30-49 1
attempted rape don’t know female 50 0
attempted rape don’t know male 15-19 0
attempted rape don’t know male 20-29 0
attempted rape don’t know male 30-49 1
attempted rape don’t know male 50 2
attempted rape no answer female 15-19 8
attempted rape no answer female 20-29 8
attempted rape no answer female 30-49 9
attempted rape no answer female 50 5
attempted rape no answer male 15-19 4
attempted rape no answer male 20-29 2
attempted rape no answer male 30-49 1
attempted rape no answer male 50 5
rape sexual harassment female 15-19 2
rape sexual harassment female 20-29 3
rape sexual harassment female 30-49 1
rape sexual harassment female 50 2
rape sexual harassment male 15-19 1
rape sexual harassment male 20-29 0
rape sexual harassment male 30-49 0
rape sexual harassment male 50 0
rape sexual violence female 15-19 8
rape sexual violence female 20-29 23
rape sexual violence female 30-49 18
rape sexual violence female 50 13
rape sexual violence male 15-19 3
rape sexual violence male 20-29 9
rape sexual violence male 30-49 3
rape sexual violence male 50 6
rape don’t know female 15-19 1
rape don’t know female 20-29 1
rape don’t know female 30-49 1
rape don’t know female 50 0
rape don’t know male 15-19 0
rape don’t know male 20-29 0
rape don’t know male 30-49 1
rape don’t know male 50 0
rape no answer female 15-19 5
rape no answer female 20-29 8
rape no answer female 30-49 9
rape no answer female 50 7
rape no answer male 15-19 2
rape no answer male 20-29 2
rape no answer male 30-49 1
rape no answer male 50 4
forced sexual initiation sexual harassment female 15-19 6
forced sexual initiation sexual harassment female 20-29 3
forced sexual initiation sexual harassment female 30-49 1
forced sexual initiation sexual harassment female 50 2
forced sexual initiation sexual harassment male 15-19 2
forced sexual initiation sexual harassment male 20-29 0
forced sexual initiation sexual harassment male 30-49 0
forced sexual initiation sexual harassment male 50 1
forced sexual initiation sexual violence female 15-19 14
forced sexual initiation sexual violence female 20-29 22
forced sexual initiation sexual violence female 30-49 18
forced sexual initiation sexual violence female 50 15
forced sexual initiation sexual violence male 15-19 5
forced sexual initiation sexual violence male 20-29 9
forced sexual initiation sexual violence male 30-49 3
forced sexual initiation sexual violence male 50 3
forced sexual initiation don’t know female 15-19 3
forced sexual initiation don’t know female 20-29 2
forced sexual initiation don’t know female 30-49 1
forced sexual initiation don’t know female 50 0
forced sexual initiation don’t know male 15-19 0
forced sexual initiation don’t know male 20-29 0
forced sexual initiation don’t know male 30-49 1
forced sexual initiation don’t know male 50 0
forced sexual initiation no answer female 15-19 8
forced sexual initiation no answer female 20-29 8
forced sexual initiation no answer female 30-49 9
forced sexual initiation no answer female 50 5
forced sexual initiation no answer male 15-19 5
forced sexual initiation no answer male 20-29 2
forced sexual initiation no answer male 30-49 1
forced sexual initiation no answer male 50 6
trafficking for the purpose of sexual exploitation sexual harassment female 15-19 2
trafficking for the purpose of sexual exploitation sexual harassment female 20-29 2
trafficking for the purpose of sexual exploitation sexual harassment female 30-49 1
trafficking for the purpose of sexual exploitation sexual harassment female 50 2
trafficking for the purpose of sexual exploitation sexual harassment male 15-19 0
trafficking for the purpose of sexual exploitation sexual harassment male 20-29 0
trafficking for the purpose of sexual exploitation sexual harassment male 30-49 0
trafficking for the purpose of sexual exploitation sexual harassment male 50 0
trafficking for the purpose of sexual exploitation sexual violence female 15-19 8
trafficking for the purpose of sexual exploitation sexual violence female 20-29 22
trafficking for the purpose of sexual exploitation sexual violence female 30-49 18
trafficking for the purpose of sexual exploitation sexual violence female 50 15
trafficking for the purpose of sexual exploitation sexual violence male 15-19 4
trafficking for the purpose of sexual exploitation sexual violence male 20-29 8
trafficking for the purpose of sexual exploitation sexual violence male 30-49 3
trafficking for the purpose of sexual exploitation sexual violence male 50 6
trafficking for the purpose of sexual exploitation don’t know female 15-19 0
trafficking for the purpose of sexual exploitation don’t know female 20-29 3
trafficking for the purpose of sexual exploitation don’t know female 30-49 1
trafficking for the purpose of sexual exploitation don’t know female 50 0
trafficking for the purpose of sexual exploitation don’t know male 15-19 0
trafficking for the purpose of sexual exploitation don’t know male 20-29 1
trafficking for the purpose of sexual exploitation don’t know male 30-49 1
trafficking for the purpose of sexual exploitation don’t know male 50 0
trafficking for the purpose of sexual exploitation no answer female 15-19 6
trafficking for the purpose of sexual exploitation no answer female 20-29 8
trafficking for the purpose of sexual exploitation no answer female 30-49 9
trafficking for the purpose of sexual exploitation no answer female 50 5
trafficking for the purpose of sexual exploitation no answer male 15-19 2
trafficking for the purpose of sexual exploitation no answer male 20-29 2
trafficking for the purpose of sexual exploitation no answer male 30-49 1
trafficking for the purpose of sexual exploitation no answer male 50 4
forced prostitution sexual harassment female 15-19 3
forced prostitution sexual harassment female 20-29 3
forced prostitution sexual harassment female 30-49 1
forced prostitution sexual harassment female 50 1
forced prostitution sexual harassment male 15-19 1
forced prostitution sexual harassment male 20-29 0
forced prostitution sexual harassment male 30-49 1
forced prostitution sexual harassment male 50 0
forced prostitution sexual violence female 15-19 7
forced prostitution sexual violence female 20-29 22
forced prostitution sexual violence female 30-49 18
forced prostitution sexual violence female 50 14
forced prostitution sexual violence male 15-19 3
forced prostitution sexual violence male 20-29 8
forced prostitution sexual violence male 30-49 3
forced prostitution sexual violence male 50 6
forced prostitution don’t know female 15-19 0
forced prostitution don’t know female 20-29 2
forced prostitution don’t know female 30-49 1
forced prostitution don’t know female 50 1
forced prostitution don’t know male 15-19 0
forced prostitution don’t know male 20-29 0
forced prostitution don’t know male 30-49 0
forced prostitution don’t know male 50 0
forced prostitution no answer female 15-19 6
forced prostitution no answer female 20-29 8
forced prostitution no answer female 30-49 9
forced prostitution no answer female 50 6
forced prostitution no answer male 15-19 2
forced prostitution no answer male 20-29 3
forced prostitution no answer male 30-49 1
forced prostitution no answer male 50 4
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
rect {
fill: none;
stroke: black;
stroke-width: 1;
}
.line {
fill: none;
stroke: black;
stroke-width: 5;
}
</style>
</head>
<body>
<script>
var margin = {};
margin.left = 20;
d3.csv("dataset.csv", function(dataset) {
dataset.forEach(function(d) {
d.value = +d.value;
})
// action :"sexual comments about.."
// age_group :"30-49"
// gender_of_respondent :"female"
// perceived_type_of_assault :"sexual violence"
// value :2
var filter_dataset = dataset.filter((d) => d["perceived_type_of_assault"] == "sexual harassment")
var agg_dataset = d3.nest()
.key(function(d) { return d["gender_of_respondent"] })
.rollup(function(leaves){ return {
"mean": d3.mean(leaves, function(d){ return d.value }),
"min": d3.min(leaves, function(d){ return d.value }),
"max": d3.max(leaves, function(d){ return d.value }),
}})
.entries(filter_dataset)
console.log(agg_dataset)
var divs = d3.selectAll("div").data(agg_dataset).enter()
.append("div")
.style("float","left")
.append("svg")
.attr("width", 960)
.attr("height", 500);
var y = d3.scaleLinear()
.domain([0, d3.max(d3.values(dataset))])
.range([0, 100]);
var x = d3.scaleOrdinal() /* derp! */
var line = d3.line()
.x(function(d, i) { return x(d['action']); })
.y(function(d) { return 200 - y(d.value); })
.curve(d3.curveBasis)
divs.selectAll("path").data((d) => { console.log(d.value.mean); return d.value.mean } )
.enter()
.append("path")
.attr("class","line")
.attr("d", line)
/* var axis = d3.axisLeft(y);
svg.append("g")
.attr("transform", "translate(20, 100)")
.call(axis);
*/
// we want two charts, one for male respondents, one for female respondents
// y axis is "value"
// x axis is the question number in a survey (action?)
// three lines in each chart - min (blue), max (red), avg (green)
var male_data = dataset.filter((d) => d.gender_of_respondent == "male")
var female_data = dataset.filter((d) => d.gender_of_respondent == "female")
/* svg.selectAll(".line").data([female_agg_value]).enter().append("path")
.attr("class", "line")
.attr("d", function(d) { console.log(d); return d.value.mean; })
*/
// console.log(female_agg_value)
})
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment