I have a csv file with data like this
PassengerId,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked
892,3,"Kelly, Mr. James",male,34.5,0,0,330911,7.8292,,Q
893,3,"Wilkes, Mrs. James (Ellen Needs)",female,47,1,0,363272,7,,S
and so on
I want to count how many of these names in the csv file include ‘Mr.’ and ‘Mrs’ and other
and using column 'sex' I want to print the number of male and female passengers.
What I have tried:
I don't know how to proceed with this task.
<script src='https://d3js.org/d3.v7.min.js'></script>
<script>
let newcsv = 'the link to csv ';
d3.csv(newcsv, function(data) {
console.log( data.Name );
});
</script>