コード例 #1
0
def importCity():
    cur.execute('SELECT  * FROM CITY')
    return cur.fetchall()
コード例 #2
0
def importCountries():
    cur.execute('SELECT  * FROM COUNTRY')
    return cur.fetchall()
コード例 #3
0
def getGoals():
    cur.execute('SELECT home_score,away_score FROM GAME')
    return cur.fetchall()
コード例 #4
0
def importGames():
    cur.execute('SELECT  * FROM GAME')
    return cur.fetchall()
コード例 #5
0
def importTournament():
    cur.execute('SELECT  * FROM TOURNAMENT')
    return cur.fetchall()
コード例 #6
0
def importTeams():
    cur.execute('SELECT  * FROM TEAM')
    return cur.fetchall()
コード例 #7
0
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()