This commit is contained in:
s434695 2021-04-11 16:00:20 +02:00
parent 4210268918
commit 1791d3b537

34
zadanie2.py Executable file
View File

@ -0,0 +1,34 @@
#! /usr/bin/python3
import requests
url = 'https://git.wmi.amu.edu.pl/s434695/ium_434695/raw/commit/2301fb86e434734376f73503307a8f3255a75cc6/vgsales.csv'
r = requests.get(url, allow_redirects=True)
open('vgsales.csv', 'wb').write(r.content)
import pandas as pd
vgsales = pd.read_csv('vgsales.csv')
vgsales
vgsales.describe(include='all')
vgsales["Publisher"].value_counts()
vgsales["Platform"].value_counts()
vgsales["Platform"].value_counts().plot(kind="bar")
vgsales[["Platform","JP_Sales"]].groupby("Platform").mean().plot(kind="bar")
import seaborn as sns
sns.set_theme()
sns.relplot(data=vgsales, x="JP_Sales", y="NA_Sales", hue="Genre")
from sklearn.model_selection import train_test_split
vgsales_train, vgsales_test = train_test_split(vgsales, test_size = 0.6, random_state = 1)
vgsales_train["Platform"].value_counts()
vgsales_test["Platform"].value_counts()
print(vgsales_train["Platform"])