<jupyter_start><jupyter_text>Class exercises:Make a function that:1. Create a data frame with this:<jupyter_code>import pandas as pd

names=["Tomás", "Pauline", "Pablo", "Bjork","Alan","Juana"]
woman=[False,True,False,False,False,True]
ages=[32,33,28,30,32,27]
country=["Chile", "Senegal", "Spain", "Norway","Peru","Peru"]
education=["Bach", "Bach", "Master", "PhD","Bach","Master"]

data={'names':names, 'woman':woman, 'ages':ages, 'country':country, 'education':education}

friends=pd.DataFrame.from_dict(data)
friends<jupyter_output><empty_output><jupyter_text>Homework 1. Implement a _for_ loop to get the count of men that have a Bach degree in the data frame. I recommend the use of **zip** (somwehere)<jupyter_code>MaleBachCounter=0 #counter

for (woman,degree) in (zip(friends.woman,friends.education)):
    if woman==False:
        if degree=="Bach":
            MaleBachCounter +=1
            
#Results
MaleBachCounter<jupyter_output><empty_output><jupyter_text>2. Implement a _for_ loop to get the count of people whose current age is an even number.<jupyter_code>EvenAgeCounter=0

for age in friends.ages:
    if age%2==0:
        EvenAgeCounter +=1
        
#results
EvenAgeCounter<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14448979591836736, 'fraction_numerical': 0.017142857142857144, 'mean_word_length': 6.005714285714285, 'pattern_counts': {'":': 1, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '436036', 'license': 'MIT', 'n_tokens_mistral': 447, 'n_tokens_neox': 421, 'n_words': 102, 'path': 'hw_controlOfEx.ipynb', 'repo_name': 'vcewing/ComputationalThinking_Gov_1', 'size': '1225'}