{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "61ecb1f4", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "sns.set()" ] }, { "cell_type": "code", "execution_count": 376, "id": "a822aac7", "metadata": {}, "outputs": [], "source": [ "# Load the dataset\n", "df = pd.read_csv('../data/SteamCharts.csv', encoding='unicode_escape')\n", "df_st = pd.read_csv('../data/games.csv')" ] }, { "cell_type": "code", "execution_count": 340, "id": "43062e92", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
gamenameyearmonthavggainpeakavg_peak_perc
0Counter-Strike: Global Offensive2021February741013.24-2196.42112348565.9567%
1Counter-Strike: Global Offensive2021January743209.6625405.91112455366.0893%
2Counter-Strike: Global Offensive2020December717803.7549049.17116439661.646%
3Counter-Strike: Global Offensive2020November668754.5855087.89103746464.4605%
4Counter-Strike: Global Offensive2020October613666.696816.3794387665.0156%
\n", "
" ], "text/plain": [ " gamename year month avg gain \\\n", "0 Counter-Strike: Global Offensive 2021 February 741013.24 -2196.42 \n", "1 Counter-Strike: Global Offensive 2021 January 743209.66 25405.91 \n", "2 Counter-Strike: Global Offensive 2020 December 717803.75 49049.17 \n", "3 Counter-Strike: Global Offensive 2020 November 668754.58 55087.89 \n", "4 Counter-Strike: Global Offensive 2020 October 613666.69 6816.37 \n", "\n", " peak avg_peak_perc \n", "0 1123485 65.9567% \n", "1 1124553 66.0893% \n", "2 1164396 61.646% \n", "3 1037464 64.4605% \n", "4 943876 65.0156% " ] }, "execution_count": 340, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 341, "id": "5be927c0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
AppIDNameRelease dateEstimated ownersPeak CCURequired agePriceDLC countAbout the gameSupported languages...Average playtime two weeksMedian playtime foreverMedian playtime two weeksDevelopersPublishersCategoriesGenresTagsScreenshotsMovies
020200Galactic BowlingOct 21, 20080 - 200000019.990Galactic Bowling is an exaggerated and stylize...['English']...000Perpetual FX CreativePerpetual FX CreativeSingle-player,Multi-player,Steam Achievements,...Casual,Indie,SportsIndie,Casual,Sports,Bowlinghttps://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
1655370Train BanditOct 12, 20170 - 20000000.990THE LAW!! Looks to be a showdown atop a train....['English', 'French', 'Italian', 'German', 'Sp......000Rusty MoyherWild RoosterSingle-player,Steam Achievements,Full controll...Action,IndieIndie,Action,Pixel Graphics,2D,Retro,Arcade,Sc...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
21732930Jolt ProjectNov 17, 20210 - 20000004.990Jolt Project: The army now has a new robotics ...['English', 'Portuguese - Brazil']...000Campião GamesCampião GamesSingle-playerAction,Adventure,Indie,StrategyNaNhttps://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
31355720Henosis™Jul 23, 20200 - 20000005.990HENOSIS™ is a mysterious 2D Platform Puzzler w...['English', 'French', 'Italian', 'German', 'Sp......000Odd Critter GamesOdd Critter GamesSingle-player,Full controller supportAdventure,Casual,Indie2D Platformer,Atmospheric,Surreal,Mystery,Puzz...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
41139950Two Weeks in PainlandFeb 3, 20200 - 20000000.000ABOUT THE GAME Play as a hacker who has arrang...['English', 'Spanish - Spain']...000Unusual GamesUnusual GamesSingle-player,Steam AchievementsAdventure,IndieIndie,Adventure,Nudity,Violent,Sexual Content,...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
\n", "

5 rows × 39 columns

\n", "
" ], "text/plain": [ " AppID Name Release date Estimated owners Peak CCU \\\n", "0 20200 Galactic Bowling Oct 21, 2008 0 - 20000 0 \n", "1 655370 Train Bandit Oct 12, 2017 0 - 20000 0 \n", "2 1732930 Jolt Project Nov 17, 2021 0 - 20000 0 \n", "3 1355720 Henosis™ Jul 23, 2020 0 - 20000 0 \n", "4 1139950 Two Weeks in Painland Feb 3, 2020 0 - 20000 0 \n", "\n", " Required age Price DLC count \\\n", "0 0 19.99 0 \n", "1 0 0.99 0 \n", "2 0 4.99 0 \n", "3 0 5.99 0 \n", "4 0 0.00 0 \n", "\n", " About the game \\\n", "0 Galactic Bowling is an exaggerated and stylize... \n", "1 THE LAW!! Looks to be a showdown atop a train.... \n", "2 Jolt Project: The army now has a new robotics ... \n", "3 HENOSIS™ is a mysterious 2D Platform Puzzler w... \n", "4 ABOUT THE GAME Play as a hacker who has arrang... \n", "\n", " Supported languages ... \\\n", "0 ['English'] ... \n", "1 ['English', 'French', 'Italian', 'German', 'Sp... ... \n", "2 ['English', 'Portuguese - Brazil'] ... \n", "3 ['English', 'French', 'Italian', 'German', 'Sp... ... \n", "4 ['English', 'Spanish - Spain'] ... \n", "\n", " Average playtime two weeks Median playtime forever \\\n", "0 0 0 \n", "1 0 0 \n", "2 0 0 \n", "3 0 0 \n", "4 0 0 \n", "\n", " Median playtime two weeks Developers Publishers \\\n", "0 0 Perpetual FX Creative Perpetual FX Creative \n", "1 0 Rusty Moyher Wild Rooster \n", "2 0 Campião Games Campião Games \n", "3 0 Odd Critter Games Odd Critter Games \n", "4 0 Unusual Games Unusual Games \n", "\n", " Categories \\\n", "0 Single-player,Multi-player,Steam Achievements,... \n", "1 Single-player,Steam Achievements,Full controll... \n", "2 Single-player \n", "3 Single-player,Full controller support \n", "4 Single-player,Steam Achievements \n", "\n", " Genres \\\n", "0 Casual,Indie,Sports \n", "1 Action,Indie \n", "2 Action,Adventure,Indie,Strategy \n", "3 Adventure,Casual,Indie \n", "4 Adventure,Indie \n", "\n", " Tags \\\n", "0 Indie,Casual,Sports,Bowling \n", "1 Indie,Action,Pixel Graphics,2D,Retro,Arcade,Sc... \n", "2 NaN \n", "3 2D Platformer,Atmospheric,Surreal,Mystery,Puzz... \n", "4 Indie,Adventure,Nudity,Violent,Sexual Content,... \n", "\n", " Screenshots \\\n", "0 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "1 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "2 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "3 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "4 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "\n", " Movies \n", "0 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "1 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "2 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "3 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "4 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "\n", "[5 rows x 39 columns]" ] }, "execution_count": 341, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_st.head()" ] }, { "cell_type": "code", "execution_count": 378, "id": "02c9c574", "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(83789, 8)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
gamenameyearmonthavggainpeakavg_peak_percdate
0Counter-Strike: Global Offensive2021February741013.24-2196.42112348565.9567%2021-02-01
1Counter-Strike: Global Offensive2021January743209.6625405.91112455366.0893%2021-01-01
2Counter-Strike: Global Offensive2020December717803.7549049.17116439661.646%2020-12-01
3Counter-Strike: Global Offensive2020November668754.5855087.89103746464.4605%2020-11-01
4Counter-Strike: Global Offensive2020October613666.696816.3794387665.0156%2020-10-01
\n", "
" ], "text/plain": [ " gamename year month avg gain \\\n", "0 Counter-Strike: Global Offensive 2021 February 741013.24 -2196.42 \n", "1 Counter-Strike: Global Offensive 2021 January 743209.66 25405.91 \n", "2 Counter-Strike: Global Offensive 2020 December 717803.75 49049.17 \n", "3 Counter-Strike: Global Offensive 2020 November 668754.58 55087.89 \n", "4 Counter-Strike: Global Offensive 2020 October 613666.69 6816.37 \n", "\n", " peak avg_peak_perc date \n", "0 1123485 65.9567% 2021-02-01 \n", "1 1124553 66.0893% 2021-01-01 \n", "2 1164396 61.646% 2020-12-01 \n", "3 1037464 64.4605% 2020-11-01 \n", "4 943876 65.0156% 2020-10-01 " ] }, "execution_count": 378, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Popularity - Clean and format the data\n", "df['year'] = df['year'].astype(str).str.strip()\n", "df['month'] = df['month'].astype(str).str.strip()\n", "df['date'] = pd.to_datetime(df['year'] + \" \" + df['month'], format=\"%Y %B\", errors='coerce')\n", "df.columns = df.columns.str.replace(' ', '_')\n", "df.columns = df.columns.str.lower()\n", "print(df.shape)\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 343, "id": "0955a9bd", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/plain": [ "AppID 0\n", "Name 2\n", "Release date 0\n", "Estimated owners 0\n", "Peak CCU 0\n", "Required age 0\n", "Price 0\n", "DLC count 0\n", "About the game 2917\n", "Supported languages 0\n", "Full audio languages 0\n", "Reviews 67625\n", "Header image 0\n", "Website 40308\n", "Support url 38759\n", "Support email 12090\n", "Windows 0\n", "Mac 0\n", "Linux 0\n", "Metacritic score 0\n", "Metacritic url 73195\n", "User score 0\n", "Positive 0\n", "Negative 0\n", "Score rank 76945\n", "Achievements 0\n", "Recommendations 0\n", "Notes 65484\n", "Average playtime forever 0\n", "Average playtime two weeks 0\n", "Median playtime forever 0\n", "Median playtime two weeks 0\n", "Developers 2940\n", "Publishers 3176\n", "Categories 3916\n", "Genres 2918\n", "Tags 17465\n", "Screenshots 1618\n", "Movies 5618\n", "dtype: int64" ] }, "execution_count": 343, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_st.isna().sum()" ] }, { "cell_type": "code", "execution_count": 379, "id": "0e246b32", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
AppIDNameRelease dateEstimated ownersPeak CCURequired agePriceDLC countAbout the gameSupported languages...Average playtime two weeksMedian playtime foreverMedian playtime two weeksDevelopersPublishersCategoriesGenresTagsScreenshotsMovies
020200Galactic BowlingOct 21, 20080 - 200000019.990Galactic Bowling is an exaggerated and stylize...['English']...000Perpetual FX CreativePerpetual FX CreativeSingle-player,Multi-player,Steam Achievements,...Casual,Indie,SportsIndie,Casual,Sports,Bowlinghttps://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
1655370Train BanditOct 12, 20170 - 20000000.990THE LAW!! Looks to be a showdown atop a train....['English', 'French', 'Italian', 'German', 'Sp......000Rusty MoyherWild RoosterSingle-player,Steam Achievements,Full controll...Action,IndieIndie,Action,Pixel Graphics,2D,Retro,Arcade,Sc...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
21732930Jolt ProjectNov 17, 20210 - 20000004.990Jolt Project: The army now has a new robotics ...['English', 'Portuguese - Brazil']...000Campião GamesCampião GamesSingle-playerAction,Adventure,Indie,StrategyN/Ahttps://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
31355720Henosis™Jul 23, 20200 - 20000005.990HENOSIS™ is a mysterious 2D Platform Puzzler w...['English', 'French', 'Italian', 'German', 'Sp......000Odd Critter GamesOdd Critter GamesSingle-player,Full controller supportAdventure,Casual,Indie2D Platformer,Atmospheric,Surreal,Mystery,Puzz...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
41139950Two Weeks in PainlandFeb 3, 20200 - 20000000.000ABOUT THE GAME Play as a hacker who has arrang...['English', 'Spanish - Spain']...000Unusual GamesUnusual GamesSingle-player,Steam AchievementsAdventure,IndieIndie,Adventure,Nudity,Violent,Sexual Content,...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...
\n", "

5 rows × 39 columns

\n", "
" ], "text/plain": [ " AppID Name Release date Estimated owners Peak CCU \\\n", "0 20200 Galactic Bowling Oct 21, 2008 0 - 20000 0 \n", "1 655370 Train Bandit Oct 12, 2017 0 - 20000 0 \n", "2 1732930 Jolt Project Nov 17, 2021 0 - 20000 0 \n", "3 1355720 Henosis™ Jul 23, 2020 0 - 20000 0 \n", "4 1139950 Two Weeks in Painland Feb 3, 2020 0 - 20000 0 \n", "\n", " Required age Price DLC count \\\n", "0 0 19.99 0 \n", "1 0 0.99 0 \n", "2 0 4.99 0 \n", "3 0 5.99 0 \n", "4 0 0.00 0 \n", "\n", " About the game \\\n", "0 Galactic Bowling is an exaggerated and stylize... \n", "1 THE LAW!! Looks to be a showdown atop a train.... \n", "2 Jolt Project: The army now has a new robotics ... \n", "3 HENOSIS™ is a mysterious 2D Platform Puzzler w... \n", "4 ABOUT THE GAME Play as a hacker who has arrang... \n", "\n", " Supported languages ... \\\n", "0 ['English'] ... \n", "1 ['English', 'French', 'Italian', 'German', 'Sp... ... \n", "2 ['English', 'Portuguese - Brazil'] ... \n", "3 ['English', 'French', 'Italian', 'German', 'Sp... ... \n", "4 ['English', 'Spanish - Spain'] ... \n", "\n", " Average playtime two weeks Median playtime forever \\\n", "0 0 0 \n", "1 0 0 \n", "2 0 0 \n", "3 0 0 \n", "4 0 0 \n", "\n", " Median playtime two weeks Developers Publishers \\\n", "0 0 Perpetual FX Creative Perpetual FX Creative \n", "1 0 Rusty Moyher Wild Rooster \n", "2 0 Campião Games Campião Games \n", "3 0 Odd Critter Games Odd Critter Games \n", "4 0 Unusual Games Unusual Games \n", "\n", " Categories \\\n", "0 Single-player,Multi-player,Steam Achievements,... \n", "1 Single-player,Steam Achievements,Full controll... \n", "2 Single-player \n", "3 Single-player,Full controller support \n", "4 Single-player,Steam Achievements \n", "\n", " Genres \\\n", "0 Casual,Indie,Sports \n", "1 Action,Indie \n", "2 Action,Adventure,Indie,Strategy \n", "3 Adventure,Casual,Indie \n", "4 Adventure,Indie \n", "\n", " Tags \\\n", "0 Indie,Casual,Sports,Bowling \n", "1 Indie,Action,Pixel Graphics,2D,Retro,Arcade,Sc... \n", "2 N/A \n", "3 2D Platformer,Atmospheric,Surreal,Mystery,Puzz... \n", "4 Indie,Adventure,Nudity,Violent,Sexual Content,... \n", "\n", " Screenshots \\\n", "0 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "1 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "2 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "3 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "4 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "\n", " Movies \n", "0 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "1 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "2 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "3 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "4 http://cdn.akamai.steamstatic.com/steam/apps/2... \n", "\n", "[5 rows x 39 columns]" ] }, "execution_count": 379, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Steam games - Filling up Null values\n", "df_st = df_st.dropna(subset = ['Name'])\n", "values = {\n", " \"About the game\": \"N/A\", \n", "# \"Full audio languages\": [\"N/A\"], \n", " \"Reviews\": \"N/A\", \n", " \"Website\": \"N/A\", \n", " \"Support url\": \"N/A\", \n", " \"Support email\": \"N/A\", \n", " \"Metacritic url\": \"N/A\", \n", " \"Notes\": \"N/A\", \n", " \"Developers\": \"N/A\", \n", " \"Publishers\": \"N/A\", \n", " \"Categories\": \"Undefined\", \n", " \"Genres\": \"Undefined\", \n", " \"Tags\": \"N/A\", \n", " \"Screenshots\": \"N/A\", \n", " \"Movies\": \"N/A\", \n", "}\n", "df_st = df_st.fillna(value=values)\n", "df_st.head()" ] }, { "cell_type": "code", "execution_count": 380, "id": "c1648689", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
appidgamenamerelease_dateestimated_ownerspeak_ccurequired_agepricedlc_countabout_the_gamesupported_languages...median_playtime_forevermedian_playtime_two_weeksdeveloperspublisherscategoriesgenrestagsscreenshotsmoviesrelease_year
020200Galactic Bowling2008-10-210 - 200000019.990Galactic Bowling is an exaggerated and stylize...['English']...00Perpetual FX CreativePerpetual FX CreativeSingle-player,Multi-player,Steam Achievements,...Casual,Indie,SportsIndie,Casual,Sports,Bowlinghttps://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...2008
1655370Train Bandit2017-10-120 - 20000000.990THE LAW!! Looks to be a showdown atop a train....['English', 'French', 'Italian', 'German', 'Sp......00Rusty MoyherWild RoosterSingle-player,Steam Achievements,Full controll...Action,IndieIndie,Action,Pixel Graphics,2D,Retro,Arcade,Sc...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...2017
21732930Jolt Project2021-11-170 - 20000004.990Jolt Project: The army now has a new robotics ...['English', 'Portuguese - Brazil']...00Campião GamesCampião GamesSingle-playerAction,Adventure,Indie,StrategyN/Ahttps://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...2021
31355720Henosis™2020-07-230 - 20000005.990HENOSIS™ is a mysterious 2D Platform Puzzler w...['English', 'French', 'Italian', 'German', 'Sp......00Odd Critter GamesOdd Critter GamesSingle-player,Full controller supportAdventure,Casual,Indie2D Platformer,Atmospheric,Surreal,Mystery,Puzz...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...2020
41139950Two Weeks in Painland2020-02-030 - 20000000.000ABOUT THE GAME Play as a hacker who has arrang...['English', 'Spanish - Spain']...00Unusual GamesUnusual GamesSingle-player,Steam AchievementsAdventure,IndieIndie,Adventure,Nudity,Violent,Sexual Content,...https://cdn.akamai.steamstatic.com/steam/apps/...http://cdn.akamai.steamstatic.com/steam/apps/2...2020
\n", "

5 rows × 40 columns

\n", "
" ], "text/plain": [ " appid gamename release_date estimated_owners peak_ccu \\\n", "0 20200 Galactic Bowling 2008-10-21 0 - 20000 0 \n", "1 655370 Train Bandit 2017-10-12 0 - 20000 0 \n", "2 1732930 Jolt Project 2021-11-17 0 - 20000 0 \n", "3 1355720 Henosis™ 2020-07-23 0 - 20000 0 \n", "4 1139950 Two Weeks in Painland 2020-02-03 0 - 20000 0 \n", "\n", " required_age price dlc_count \\\n", "0 0 19.99 0 \n", "1 0 0.99 0 \n", "2 0 4.99 0 \n", "3 0 5.99 0 \n", "4 0 0.00 0 \n", "\n", " about_the_game \\\n", "0 Galactic Bowling is an exaggerated and stylize... \n", "1 THE LAW!! Looks to be a showdown atop a train.... \n", "2 Jolt Project: The army now has a new robotics ... \n", "3 HENOSIS™ is a mysterious 2D Platform Puzzler w... \n", "4 ABOUT THE GAME Play as a hacker who has arrang... \n", "\n", " supported_languages ... \\\n", "0 ['English'] ... \n", "1 ['English', 'French', 'Italian', 'German', 'Sp... ... \n", "2 ['English', 'Portuguese - Brazil'] ... \n", "3 ['English', 'French', 'Italian', 'German', 'Sp... ... \n", "4 ['English', 'Spanish - Spain'] ... \n", "\n", " median_playtime_forever median_playtime_two_weeks developers \\\n", "0 0 0 Perpetual FX Creative \n", "1 0 0 Rusty Moyher \n", "2 0 0 Campião Games \n", "3 0 0 Odd Critter Games \n", "4 0 0 Unusual Games \n", "\n", " publishers categories \\\n", "0 Perpetual FX Creative Single-player,Multi-player,Steam Achievements,... \n", "1 Wild Rooster Single-player,Steam Achievements,Full controll... \n", "2 Campião Games Single-player \n", "3 Odd Critter Games Single-player,Full controller support \n", "4 Unusual Games Single-player,Steam Achievements \n", "\n", " genres \\\n", "0 Casual,Indie,Sports \n", "1 Action,Indie \n", "2 Action,Adventure,Indie,Strategy \n", "3 Adventure,Casual,Indie \n", "4 Adventure,Indie \n", "\n", " tags \\\n", "0 Indie,Casual,Sports,Bowling \n", "1 Indie,Action,Pixel Graphics,2D,Retro,Arcade,Sc... \n", "2 N/A \n", "3 2D Platformer,Atmospheric,Surreal,Mystery,Puzz... \n", "4 Indie,Adventure,Nudity,Violent,Sexual Content,... \n", "\n", " screenshots \\\n", "0 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "1 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "2 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "3 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "4 https://cdn.akamai.steamstatic.com/steam/apps/... \n", "\n", " movies release_year \n", "0 http://cdn.akamai.steamstatic.com/steam/apps/2... 2008 \n", "1 http://cdn.akamai.steamstatic.com/steam/apps/2... 2017 \n", "2 http://cdn.akamai.steamstatic.com/steam/apps/2... 2021 \n", "3 http://cdn.akamai.steamstatic.com/steam/apps/2... 2020 \n", "4 http://cdn.akamai.steamstatic.com/steam/apps/2... 2020 \n", "\n", "[5 rows x 40 columns]" ] }, "execution_count": 380, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Steam games - Clean and format the data\n", "df_st.columns = df_st.columns.str.replace(' ', '_')\n", "df_st.columns = df_st.columns.str.lower()\n", "df_st = df_st.rename(columns = {\"name\": \"gamename\"})\n", "df_st['release_date'] = pd.to_datetime(df_st['release_date'])\n", "df_st['release_year'] = df_st['release_date'].dt.strftime('%Y')\n", "df_st.head()" ] }, { "cell_type": "code", "execution_count": 381, "id": "55921926", "metadata": { "scrolled": true }, "outputs": [], "source": [ "# Adding is multiplayer\n", "# df_st['multi-player']*=1\n", "\n", "# Category - multi/single player\n", "df_st['multi_player'] = (df_st.categories.str.contains('Multi-player')==True)*1\n", "df_st['pvp'] = (df_st.categories.str.contains('PvP')==True)*1\n", "df_st['co-op'] = (df_st.categories.str.contains('Co-op')==True)*1\n", "\n", "# Genres\n", "df_st['genre_action'] = (df_st.genres.str.contains('Action')==True)*1\n", "df_st['genre_adventure'] = (df_st.genres.str.contains('Adventure')==True)*1\n", "df_st['genre_casual'] = (df_st.genres.str.contains('Casual')==True)*1\n", "df_st['genre_sexual_content'] = (df_st.genres.str.contains('Sexual Content')==True)*1\n", "df_st['genre_strategy'] = (df_st.genres.str.contains('Strategy')==True)*1\n", "df_st['genre_sports'] = (df_st.genres.str.contains('Sports')==True)*1\n", "df_st['genre_racing'] = (df_st.genres.str.contains('Racing')==True)*1\n", "df_st['genre_rpg'] = (df_st.genres.str.contains('RPG')==True)*1\n", "df_st['genre_simulation'] = (df_st.genres.str.contains('Simulation')==True)*1\n", "df_st['indie'] = (df_st.genres.str.contains('Indie')==True)*1\n", "\n", "# Setting option\n", "df_st['full_audio'] = (df_st['full_audio_languages'] != '[]')*1\n", "df_st['full_controller_support'] = (df_st.categories.str.contains('Full controller support')==True)*1\n", "df_st['windows'] = df_st.windows*1\n", "df_st['linux'] = df_st.linux*1\n", "df_st['mac'] = df_st.mac*1" ] }, { "cell_type": "code", "execution_count": 382, "id": "49914517", "metadata": { "collapsed": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 0 17 18 10 13 16 6 14 12 15 3 21 7 5 20 1 19 9]\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
appidgamenamerelease_dateestimated_ownerspeak_ccurequired_agepricedlc_countabout_the_gamesupported_languages...genre_sportsgenre_racinggenre_rpggenre_simulationindiefull_audiofull_controller_supportage_0_plusage_13_plusage_18_plus
020200Galactic Bowling2008-10-210 - 200000019.990Galactic Bowling is an exaggerated and stylize...['English']...1000100100
1655370Train Bandit2017-10-120 - 20000000.990THE LAW!! Looks to be a showdown atop a train....['English', 'French', 'Italian', 'German', 'Sp......0000101100
21732930Jolt Project2021-11-170 - 20000004.990Jolt Project: The army now has a new robotics ...['English', 'Portuguese - Brazil']...0000100100
31355720Henosis™2020-07-230 - 20000005.990HENOSIS™ is a mysterious 2D Platform Puzzler w...['English', 'French', 'Italian', 'German', 'Sp......0000101100
41139950Two Weeks in Painland2020-02-030 - 20000000.000ABOUT THE GAME Play as a hacker who has arrang...['English', 'Spanish - Spain']...0000100100
\n", "

5 rows × 58 columns

\n", "
" ], "text/plain": [ " appid gamename release_date estimated_owners peak_ccu \\\n", "0 20200 Galactic Bowling 2008-10-21 0 - 20000 0 \n", "1 655370 Train Bandit 2017-10-12 0 - 20000 0 \n", "2 1732930 Jolt Project 2021-11-17 0 - 20000 0 \n", "3 1355720 Henosis™ 2020-07-23 0 - 20000 0 \n", "4 1139950 Two Weeks in Painland 2020-02-03 0 - 20000 0 \n", "\n", " required_age price dlc_count \\\n", "0 0 19.99 0 \n", "1 0 0.99 0 \n", "2 0 4.99 0 \n", "3 0 5.99 0 \n", "4 0 0.00 0 \n", "\n", " about_the_game \\\n", "0 Galactic Bowling is an exaggerated and stylize... \n", "1 THE LAW!! Looks to be a showdown atop a train.... \n", "2 Jolt Project: The army now has a new robotics ... \n", "3 HENOSIS™ is a mysterious 2D Platform Puzzler w... \n", "4 ABOUT THE GAME Play as a hacker who has arrang... \n", "\n", " supported_languages ... genre_sports \\\n", "0 ['English'] ... 1 \n", "1 ['English', 'French', 'Italian', 'German', 'Sp... ... 0 \n", "2 ['English', 'Portuguese - Brazil'] ... 0 \n", "3 ['English', 'French', 'Italian', 'German', 'Sp... ... 0 \n", "4 ['English', 'Spanish - Spain'] ... 0 \n", "\n", " genre_racing genre_rpg genre_simulation indie full_audio \\\n", "0 0 0 0 1 0 \n", "1 0 0 0 1 0 \n", "2 0 0 0 1 0 \n", "3 0 0 0 1 0 \n", "4 0 0 0 1 0 \n", "\n", " full_controller_support age_0_plus age_13_plus age_18_plus \n", "0 0 1 0 0 \n", "1 1 1 0 0 \n", "2 0 1 0 0 \n", "3 1 1 0 0 \n", "4 0 1 0 0 \n", "\n", "[5 rows x 58 columns]" ] }, "execution_count": 382, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Entertainment Software Rating Board (ESRB) ['0+', '10+', '13+', '18+']\n", "print(df_st.required_age.unique())\n", "lower = 0; upper = 13\n", "condition = (df_st['required_age']>=lower) & (df_st['required_age']=lower) & (df_st['required_age']=lower) & (df_st['required_age']\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
gamenamerelease_daterequired_agepricedlc_countwindowsmaclinuxmetacritic_scorepositive...genre_sportsgenre_racinggenre_rpggenre_simulationindiefull_audiofull_controller_supportage_0_plusage_13_plusage_18_plus
0Galactic Bowling2008-10-21019.99010006...1000100100
1Train Bandit2017-10-1200.990110053...0000101100
2Jolt Project2021-11-1704.99010000...0000100100
3Henosis™2020-07-2305.99011103...0000101100
4Two Weeks in Painland2020-02-0300.000110050...0000100100
\n", "

5 rows × 35 columns

\n", "" ], "text/plain": [ " gamename release_date required_age price dlc_count \\\n", "0 Galactic Bowling 2008-10-21 0 19.99 0 \n", "1 Train Bandit 2017-10-12 0 0.99 0 \n", "2 Jolt Project 2021-11-17 0 4.99 0 \n", "3 Henosis™ 2020-07-23 0 5.99 0 \n", "4 Two Weeks in Painland 2020-02-03 0 0.00 0 \n", "\n", " windows mac linux metacritic_score positive ... genre_sports \\\n", "0 1 0 0 0 6 ... 1 \n", "1 1 1 0 0 53 ... 0 \n", "2 1 0 0 0 0 ... 0 \n", "3 1 1 1 0 3 ... 0 \n", "4 1 1 0 0 50 ... 0 \n", "\n", " genre_racing genre_rpg genre_simulation indie full_audio \\\n", "0 0 0 0 1 0 \n", "1 0 0 0 1 0 \n", "2 0 0 0 1 0 \n", "3 0 0 0 1 0 \n", "4 0 0 0 1 0 \n", "\n", " full_controller_support age_0_plus age_13_plus age_18_plus \n", "0 0 1 0 0 \n", "1 1 1 0 0 \n", "2 0 1 0 0 \n", "3 1 1 0 0 \n", "4 0 1 0 0 \n", "\n", "[5 rows x 35 columns]" ] }, "execution_count": 441, "metadata": {}, "output_type": "execute_result" } ], "source": [ "values = ['gamename', 'release_date', \n", " 'required_age', 'price', 'dlc_count', \n", " 'windows', 'mac', 'linux', \n", " 'metacritic_score', 'positive', 'negative',\n", " 'developers', 'publishers', \n", " 'average_playtime_forever', 'average_playtime_two_weeks',\n", " 'median_playtime_forever', 'median_playtime_two_weeks', \n", " 'multi_player', 'pvp', 'co-op', \n", " 'genre_action', 'genre_adventure', 'genre_casual', \n", " 'genre_sexual_content', 'genre_strategy', 'genre_sports', \n", " 'genre_racing','genre_rpg', 'genre_simulation', \n", " 'indie', 'full_audio', 'full_controller_support',\n", " 'age_0_plus', 'age_13_plus', 'age_18_plus'\n", " ]\n", "st = df_st[values]\n", "st.head()" ] }, { "cell_type": "code", "execution_count": 442, "id": "7f04377b", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
gamenameyearmonthavggainpeakavg_peak_percdate
0Counter-Strike: Global Offensive2021February741013.24-2196.42112348565.9567%2021-02-01
1Counter-Strike: Global Offensive2021January743209.6625405.91112455366.0893%2021-01-01
2Counter-Strike: Global Offensive2020December717803.7549049.17116439661.646%2020-12-01
3Counter-Strike: Global Offensive2020November668754.5855087.89103746464.4605%2020-11-01
4Counter-Strike: Global Offensive2020October613666.696816.3794387665.0156%2020-10-01
\n", "
" ], "text/plain": [ " gamename year month avg gain \\\n", "0 Counter-Strike: Global Offensive 2021 February 741013.24 -2196.42 \n", "1 Counter-Strike: Global Offensive 2021 January 743209.66 25405.91 \n", "2 Counter-Strike: Global Offensive 2020 December 717803.75 49049.17 \n", "3 Counter-Strike: Global Offensive 2020 November 668754.58 55087.89 \n", "4 Counter-Strike: Global Offensive 2020 October 613666.69 6816.37 \n", "\n", " peak avg_peak_perc date \n", "0 1123485 65.9567% 2021-02-01 \n", "1 1124553 66.0893% 2021-01-01 \n", "2 1164396 61.646% 2020-12-01 \n", "3 1037464 64.4605% 2020-11-01 \n", "4 943876 65.0156% 2020-10-01 " ] }, "execution_count": 442, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 443, "id": "b06f4605", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(83789, 8)\n", "(62109, 7)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
yearmonthavggainpeakavg_peak_percdate
gamename
Counter-Strike: Global Offensive2021February741013.24-2196.42112348565.9567%2021-02-01
Counter-Strike: Global Offensive2021January743209.6625405.91112455366.0893%2021-01-01
Counter-Strike: Global Offensive2020December717803.7549049.17116439661.646%2020-12-01
Counter-Strike: Global Offensive2020November668754.5855087.89103746464.4605%2020-11-01
Counter-Strike: Global Offensive2020October613666.696816.3794387665.0156%2020-10-01
\n", "
" ], "text/plain": [ " year month avg gain \\\n", "gamename \n", "Counter-Strike: Global Offensive 2021 February 741013.24 -2196.42 \n", "Counter-Strike: Global Offensive 2021 January 743209.66 25405.91 \n", "Counter-Strike: Global Offensive 2020 December 717803.75 49049.17 \n", "Counter-Strike: Global Offensive 2020 November 668754.58 55087.89 \n", "Counter-Strike: Global Offensive 2020 October 613666.69 6816.37 \n", "\n", " peak avg_peak_perc date \n", "gamename \n", "Counter-Strike: Global Offensive 1123485 65.9567% 2021-02-01 \n", "Counter-Strike: Global Offensive 1124553 66.0893% 2021-01-01 \n", "Counter-Strike: Global Offensive 1164396 61.646% 2020-12-01 \n", "Counter-Strike: Global Offensive 1037464 64.4605% 2020-11-01 \n", "Counter-Strike: Global Offensive 943876 65.0156% 2020-10-01 " ] }, "execution_count": 443, "metadata": {}, "output_type": "execute_result" } ], "source": [ "condition1 = df['gamename'].isin(st['gamename'])\n", "df_extract = df[condition1].set_index('gamename')\n", "# df_extract = df[condition1]\n", "print(df.shape)\n", "print(df_extract.shape)\n", "df_extract.head()" ] }, { "cell_type": "code", "execution_count": 444, "id": "bd8e66c1", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(76985, 35)\n", "(966, 34)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
release_daterequired_agepricedlc_countwindowsmaclinuxmetacritic_scorepositivenegative...genre_sportsgenre_racinggenre_rpggenre_simulationindiefull_audiofull_controller_supportage_0_plusage_13_plusage_18_plus
gamename
Max Payne2011-01-06173.4901008995161114...0000010010
Oxygen Not Included2019-07-30024.99211186829023014...0001110100
Borderless Gaming2015-07-2303.99110002461336...0000000100
Russian Fishing 42021-11-1000.0011000193705757...1011000100
Mafia: Definitive Edition2020-09-241739.9911000379005785...0000011010
\n", "

5 rows × 34 columns

\n", "
" ], "text/plain": [ " release_date required_age price dlc_count \\\n", "gamename \n", "Max Payne 2011-01-06 17 3.49 0 \n", "Oxygen Not Included 2019-07-30 0 24.99 2 \n", "Borderless Gaming 2015-07-23 0 3.99 1 \n", "Russian Fishing 4 2021-11-10 0 0.00 1 \n", "Mafia: Definitive Edition 2020-09-24 17 39.99 1 \n", "\n", " windows mac linux metacritic_score positive \\\n", "gamename \n", "Max Payne 1 0 0 89 9516 \n", "Oxygen Not Included 1 1 1 86 82902 \n", "Borderless Gaming 1 0 0 0 2461 \n", "Russian Fishing 4 1 0 0 0 19370 \n", "Mafia: Definitive Edition 1 0 0 0 37900 \n", "\n", " negative ... genre_sports genre_racing genre_rpg \\\n", "gamename ... \n", "Max Payne 1114 ... 0 0 0 \n", "Oxygen Not Included 3014 ... 0 0 0 \n", "Borderless Gaming 336 ... 0 0 0 \n", "Russian Fishing 4 5757 ... 1 0 1 \n", "Mafia: Definitive Edition 5785 ... 0 0 0 \n", "\n", " genre_simulation indie full_audio \\\n", "gamename \n", "Max Payne 0 0 1 \n", "Oxygen Not Included 1 1 1 \n", "Borderless Gaming 0 0 0 \n", "Russian Fishing 4 1 0 0 \n", "Mafia: Definitive Edition 0 0 1 \n", "\n", " full_controller_support age_0_plus age_13_plus \\\n", "gamename \n", "Max Payne 0 0 1 \n", "Oxygen Not Included 0 1 0 \n", "Borderless Gaming 0 1 0 \n", "Russian Fishing 4 0 1 0 \n", "Mafia: Definitive Edition 1 0 1 \n", "\n", " age_18_plus \n", "gamename \n", "Max Payne 0 \n", "Oxygen Not Included 0 \n", "Borderless Gaming 0 \n", "Russian Fishing 4 0 \n", "Mafia: Definitive Edition 0 \n", "\n", "[5 rows x 34 columns]" ] }, "execution_count": 444, "metadata": {}, "output_type": "execute_result" } ], "source": [ "condition2 = st['gamename'].isin(df['gamename'])\n", "st_extract = st[condition2].set_index('gamename')\n", "# st_extract = st[condition2]\n", "print(st.shape)\n", "print(st_extract.shape)\n", "st_extract.head()" ] }, { "cell_type": "code", "execution_count": 445, "id": "1d5f176c", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
gamenameyearmonthavggainpeakavg_peak_percdaterelease_daterequired_age...genre_sportsgenre_racinggenre_rpggenre_simulationindiefull_audiofull_controller_supportage_0_plusage_13_plusage_18_plus
0100% Orange Juice2021February278.67-25.2364543.2047%2021-02-012014-05-160...0000110100
1100% Orange Juice2021January303.89-4.1661449.4935%2021-01-012014-05-160...0000110100
2100% Orange Juice2020December308.0523.0274341.4603%2020-12-012014-05-160...0000110100
3100% Orange Juice2020November285.03-7.4162145.8986%2020-11-012014-05-160...0000110100
4100% Orange Juice2020October292.4546.6890032.4944%2020-10-012014-05-160...0000110100
..................................................................
63849theHunter Classic2014October909.46258.77229339.6625%2014-10-012014-06-030...1001010100
63850theHunter Classic2014September650.69-63.60171737.8969%2014-09-012014-06-030...1001010100
63851theHunter Classic2014August714.29-337.67118160.4818%2014-08-012014-06-030...1001010100
63852theHunter Classic2014July1051.96-110.53205951.0908%2014-07-012014-06-030...1001010100
63853theHunter Classic2014June1162.48NaN264843.9003%2014-06-012014-06-030...1001010100
\n", "

63854 rows × 42 columns

\n", "
" ], "text/plain": [ " gamename year month avg gain peak \\\n", "0 100% Orange Juice 2021 February 278.67 -25.23 645 \n", "1 100% Orange Juice 2021 January 303.89 -4.16 614 \n", "2 100% Orange Juice 2020 December 308.05 23.02 743 \n", "3 100% Orange Juice 2020 November 285.03 -7.41 621 \n", "4 100% Orange Juice 2020 October 292.45 46.68 900 \n", "... ... ... ... ... ... ... \n", "63849 theHunter Classic 2014 October 909.46 258.77 2293 \n", "63850 theHunter Classic 2014 September 650.69 -63.60 1717 \n", "63851 theHunter Classic 2014 August 714.29 -337.67 1181 \n", "63852 theHunter Classic 2014 July 1051.96 -110.53 2059 \n", "63853 theHunter Classic 2014 June 1162.48 NaN 2648 \n", "\n", " avg_peak_perc date release_date required_age ... genre_sports \\\n", "0 43.2047% 2021-02-01 2014-05-16 0 ... 0 \n", "1 49.4935% 2021-01-01 2014-05-16 0 ... 0 \n", "2 41.4603% 2020-12-01 2014-05-16 0 ... 0 \n", "3 45.8986% 2020-11-01 2014-05-16 0 ... 0 \n", "4 32.4944% 2020-10-01 2014-05-16 0 ... 0 \n", "... ... ... ... ... ... ... \n", "63849 39.6625% 2014-10-01 2014-06-03 0 ... 1 \n", "63850 37.8969% 2014-09-01 2014-06-03 0 ... 1 \n", "63851 60.4818% 2014-08-01 2014-06-03 0 ... 1 \n", "63852 51.0908% 2014-07-01 2014-06-03 0 ... 1 \n", "63853 43.9003% 2014-06-01 2014-06-03 0 ... 1 \n", "\n", " genre_racing genre_rpg genre_simulation indie full_audio \\\n", "0 0 0 0 1 1 \n", "1 0 0 0 1 1 \n", "2 0 0 0 1 1 \n", "3 0 0 0 1 1 \n", "4 0 0 0 1 1 \n", "... ... ... ... ... ... \n", "63849 0 0 1 0 1 \n", "63850 0 0 1 0 1 \n", "63851 0 0 1 0 1 \n", "63852 0 0 1 0 1 \n", "63853 0 0 1 0 1 \n", "\n", " full_controller_support age_0_plus age_13_plus age_18_plus \n", "0 0 1 0 0 \n", "1 0 1 0 0 \n", "2 0 1 0 0 \n", "3 0 1 0 0 \n", "4 0 1 0 0 \n", "... ... ... ... ... \n", "63849 0 1 0 0 \n", "63850 0 1 0 0 \n", "63851 0 1 0 0 \n", "63852 0 1 0 0 \n", "63853 0 1 0 0 \n", "\n", "[63854 rows x 42 columns]" ] }, "execution_count": 445, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_join = df_extract.join(st_extract, how='inner')\n", "df_join = df_join.reset_index()\n", "df_join" ] }, { "cell_type": "code", "execution_count": 447, "id": "e5cec592", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "63854\n", "966\n" ] }, { "data": { "text/plain": [ "Index(['gamename', 'year', 'month', 'avg', 'gain', 'peak', 'avg_peak_perc',\n", " 'date', 'release_date', 'required_age', 'price', 'dlc_count', 'windows',\n", " 'mac', 'linux', 'metacritic_score', 'positive', 'negative',\n", " 'developers', 'publishers', 'average_playtime_forever',\n", " 'average_playtime_two_weeks', 'median_playtime_forever',\n", " 'median_playtime_two_weeks', 'multi_player', 'pvp', 'co-op',\n", " 'genre_action', 'genre_adventure', 'genre_casual',\n", " 'genre_sexual_content', 'genre_strategy', 'genre_sports',\n", " 'genre_racing', 'genre_rpg', 'genre_simulation', 'indie', 'full_audio',\n", " 'full_controller_support', 'age_0_plus', 'age_13_plus', 'age_18_plus'],\n", " dtype='object')" ] }, "execution_count": 447, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(df_join.index.unique().value_counts().sum())\n", "print(st_extract.index.value_counts().sum())\n", "df_join.columns" ] }, { "cell_type": "code", "execution_count": 448, "id": "2c8a9376", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path \n", "filepath = Path('./join_02.csv') \n", "filepath.parent.mkdir(parents=True, exist_ok=True)\n", "df_join.to_csv(filepath, index=False)" ] }, { "cell_type": "code", "execution_count": 354, "id": "f7bf5e2f", "metadata": {}, "outputs": [], "source": [ "# df_st = df_st.drop(['age-0plus'], axis=1)\n", "# print(df_st['age_18_plus'].value_counts().sum())\n", "# print(df_st.required_age.unique())\n", "# df_st.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "afd5c0b8", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "e8803211", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "6780cc78", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "aa453583", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.3" } }, "nbformat": 4, "nbformat_minor": 5 }