def importCity(): cur.execute('SELECT * FROM CITY') return cur.fetchall()
def importCountries(): cur.execute('SELECT * FROM COUNTRY') return cur.fetchall()
def getGoals(): cur.execute('SELECT home_score,away_score FROM GAME') return cur.fetchall()
def importGames(): cur.execute('SELECT * FROM GAME') return cur.fetchall()
def importTournament(): cur.execute('SELECT * FROM TOURNAMENT') return cur.fetchall()
def importTeams(): cur.execute('SELECT * FROM TEAM') return cur.fetchall()
print('k=%.1f' % k) # #niezależne test_2 = stats.ttest_ind(df['home_score'], df['away_score']) print("Test: ", test_2[1]) # #zależne test_4 = stats.ttest_rel(df['home_score'], df['away_score']) print("Test: ", test_4[1]) # #regresja liniowa x = np.array(df['home_score']).reshape((-1, 1)) y = np.array(df['away_score']) model = LinearRegression() model.fit(x, y) model = LinearRegression().fit(x, y) r_sq = model.score(x, y) print('coefficient of determination:', r_sq) # # ZADANIE 7 cur.callproc('byYears') result_data = list(cur.fetchall()) df = pd.DataFrame(result_data, columns=['year', 'home_score', 'away_score']) plt.bar(df['year'], df['home_score']) plt.show() plt.bar(df['year'], df['away_score'], color='orange') plt.show()