add download dataset from kaggle

This commit is contained in:
Maciej Czajka 2022-03-21 11:33:15 +01:00
parent e0ecd91f6d
commit 11590c652d
2 changed files with 18810 additions and 1 deletions

18801
Zajęcia 2/all_games.csv Normal file

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,8 @@ import pandas as pd
import matplotlib.pyplot as plt
import sklearn.model_selection
import numpy as np
from kaggle.api.kaggle_api_extended import KaggleApi
import os
# funkcja usuwająca wiersze zawierające platformę "Stadia"
def delete_stadia(games):
@ -145,11 +147,17 @@ def dataset_information(games):
create_plot(games)
# pobranie dataset z kaggle
os.environ['KAGGLE_USERNAME'] = "maciejczajka"
os.environ['KAGGLE_KEY'] = "d8f044ad2b96d32372e22f9054c02bb1"
api = KaggleApi()
api.authenticate()
api.dataset_download_files('deepcontractor/top-video-games-19952021-metacritic', path='.', unzip=True)
# wczytanie danych
games=pd.read_csv('games.csv')
games=pd.read_csv('all_games.csv')
# usunięcie 5 wyników "Stadia"
delete_stadia(games)