Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in this. Please do it perfectly because i need to run on autograder. How i can upload the . csv file? import

I need help in this. Please do it perfectly because i need to run on autograder. How i can upload the .csv file? import pandas as pd import numpy as np import scipy.stats as stats import re nhl_df=pd.read_csv("assets/nhl.csv") cities=pd.read_html("assets/wikipedia_data.html")[1] cities=cities.iloc[:-1,[0,3,5,6,7,8]] def nhl_correlation(): # YOUR CODE HERE raise NotImplementedError() population_by_region =[] # pass in metropolitan area population from cities win_loss_by_region =[] # pass in win/loss ratio from nhl_df in the same order as cities["Metropolitan area"] assert len(population_by_region)== len(win_loss_by_region),"Q1: Your lists must be the same length" assert len(population_by_region)==28,"Q1: There should be 28 teams being analysed for NHL" return stats.pearsonr(population_by_region, win_loss_by_region) For this question, calculate the win/loss ratio's correlation with the population of the city it is in for the NHL using 2018 data. The win/loss ratio should be calculated using the following formula: win/(win+loss).[]: import pandas as pd import numpy as np import scipy.stats as stats import re nhl_df=pd.read_csv("assets/nhl.csv") cities-pd.read_html("assets/wikipedia_data.html")[1] cities-cities. iloc[:-1,[0,3,5,6,7,8]] def nhl_correlation(): # YOUR CODE HERE raise Not ImplementedError() population_by_region =[] # pass in metropolitan area population from cities win_loss_by_region =[] # pass in win/Loss ratio from nhl_df in the same order as cities ["Metropolitan area"] assert len(population_by_region)== len(win_loss_by_region),"Q1: Your lists must be the same length" assert len(population_by_region)==28,"Q1: There should be 28 teams being analysed for NHL" return stats.pearsonr(population_by_region, win_loss_by_region)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions