Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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>
Posted
Updated 17-Jan-22 7:42am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900