WORLD CUP DATA ANALYSIS
1 What player on a team with "ia" in the team name played less than 200 minutes and made more than 100 passes? Print the player surname.
2 How many players on a team with ranking <10 played more than 350 minutes?
TITANIC DATA ANALYSIS
1 Write a loop that asks the user to enter an age, then returns the number of married women over that age who embarked in Cherbourg. Terminate the loop when the user enters a number that is less than 0.
WORLD CUP DATA ANALYSIS
1.
with open('../input/assignment-5-python/World_Cup_PlayersExt.csv','r') as f:
rows = csv.DictReader(f)
count = 0
for data in rows:
if int(data['ranking'])<10 and int(data['minutes'])>350:
count = count+1
print(count,'from one file named PlayersExt')
2.
with open('../input/assignment-5-python/World_Cup_PlayersExt.csv','r') as f:
rows = csv.DictReader(f)
count = 0
for data in rows:
if int(data['ranking'])<10 and int(data['minutes'])>350:
count = count+1
print(count,'from one file named PlayersExt')
TITANIC DATA ANALYSIS
1.
with open('../input/titanic/Titanic.csv','r') as f:
married_women = 0
while True:
df = pd.read_csv("../input/titanic/Titanic.csv")
with open('../input/titanic/Titanic.csv','r') as f:
rows = csv.DictReader(f)
input_age = input('Enter age: ')
if input_age < "0":
break
married_women = 0
for data in rows:
if 'Mrs.' in data['first'] and 'Cherbourg' in data['embarked'] and data['age']>input_age:
married_women = married_women+1
print(married_women,'married women whose age more than',input_age,)
Comments
Leave a comment