coding hacks for 2.3
hacks
HACKS that are completed
Score for quiz:
pt 1: Notes
Using the Pandas python library is neccessary for complex interactions with a premade database or one generated using a dictionary. the pandas library can select and sort through the data for us, like printing out a country with the highest covid deaths at the top of a list of all of the data. Although this library is very useful, I am not sure how I could integrate this with my project, as my project does not use python for anything but has markdown as it's frontend.
Kaggle is a good source of premade databases for practicing working with databases. the databases also look legit.
database information
the databases I used are crowd-sourced databases from kaggle, meaning that there is likely no biases in the database. This is because there is simply no reason for the developers to try and manipulate the data, as there is no potential gain they could earn from it. However, the database is most likely not up-to-date as steam is a constantly updating marketplace, and prices are constantly being updated and new games are constantly being added. If I wanted to give users information about steam I would use an API, not a database that cannot update itself.
import pandas as pd
steamdata = pd.read_csv('files/games.csv').sort_values(by=['user_reviews'], ascending=False)
print("--the top 10 most popular steam games (by user reviews)------")
print(steamdata.head(10))
x = steamdata.head(10)
y = steamdata
z = steamdata.head(100)
avg = x['positive_ratio'].mean()
avg2 = y['price_final'].mean()
avg3 = z['price_final'].mean()
print("the average positive ratio of the top 10 most popular steam games is ",avg, "%")
print("")
print("the average cost of a steam game is ", avg2, "usd")
print("")
print("the average cost of the top 100 most popular steam games is ", avg3, "usd")
steamdata['date_release'] = pd.to_datetime(steamdata['date_release'])
def datasortfunc() : #sort by release date
datasort = steamdata.sort_values(by=['date_release'], ascending=True)
print(datasort.head(10))
data2 = datasort[['title']].head(10).to_string(index=False)
print("<---the 10 earliest games on steam --->")
print(data2)
datasortfunc()
print("just the title of the top 10 games")
print(steamdata[['title']].head(10).to_string(index=False))
complete output
--the top 10 most popular steam games (by user reviews)------
app_id title date_release win mac \
19041 730 Counter-Strike: Global Offensive 2012-08-21 True True
19489 578080 PUBG: BATTLEGROUNDS 2017-12-21 True False
8746 570 Dota 2 2013-07-09 True True
5347 271590 Grand Theft Auto V 2015-04-13 True False
19473 359550 Tom Clancy's Rainbow Six® Siege 2015-12-01 True False
9811 440 Team Fortress 2 2007-10-10 True True
7342 105600 Terraria 2011-05-16 True True
2335 4000 Garry's Mod 2006-11-29 True True
3764 252490 Rust 2018-02-08 True True
7155 292030 The Witcher® 3: Wild Hunt 2015-05-18 True False
linux rating positive_ratio user_reviews \
19041 True Very Positive 88 6941137
19489 False Mixed 57 2142372
8746 True Very Positive 82 1930493
5347 False Very Positive 85 1367837
19473 False Very Positive 87 939992
9811 True Very Positive 93 935635
7342 True Overwhelmingly Positive 97 867226
2335 True Overwhelmingly Positive 96 795170
3764 False Very Positive 87 722973
7155 False Overwhelmingly Positive 96 640996
price_final price_original discount steam_deck
19041 14.99 0.00 0.0 True
19489 0.00 0.00 0.0 True
8746 0.00 0.00 0.0 True
5347 0.00 0.00 0.0 True
19473 19.99 19.99 0.0 True
9811 0.00 0.00 0.0 True
7342 9.99 9.99 0.0 True
2335 9.99 9.99 0.0 True
3764 39.99 39.99 0.0 True
7155 39.99 39.99 0.0 True
the average positive ratio of the top 10 most popular steam games is 86.8 %
the average cost of a steam game is 8.750796431357113 usd
the average cost of the top 100 most popular steam games is 20.706500000000002 usd
--the top 10 oldest steam games (by date of release)------
app_id title date_release win mac linux \
16051 282010 Carmageddon Max Pack 1997-06-30 True False False
32559 232770 POSTAL 1997-11-14 True True True
10014 70 Half-Life 1998-11-08 True True True
9364 20 Team Fortress Classic 1999-04-01 True True True
35817 224920 Legacy of Kain: Soul Reaver 1999-09-08 True False False
11214 50 Half-Life: Opposing Force 1999-11-01 True True True
11441 10 Counter-Strike 2000-11-01 True True True
17624 60 Ricochet 2000-11-01 True True True
12938 130 Half-Life: Blue Shift 2001-06-01 True True True
9365 40 Deathmatch Classic 2001-06-01 True True True
rating positive_ratio user_reviews price_final \
16051 Very Positive 85 428 9.99
32559 Very Positive 85 2329 0.00
10014 Overwhelmingly Positive 96 68327 9.99
9364 Very Positive 85 5146 4.99
35817 Mostly Positive 73 1467 0.00
11214 Overwhelmingly Positive 95 14057 4.99
11441 Overwhelmingly Positive 97 132250 9.99
17624 Very Positive 80 3395 4.99
12938 Very Positive 91 10522 4.99
9365 Mostly Positive 79 1757 4.99
price_original discount steam_deck
16051 9.99 0.0 True
32559 0.00 0.0 True
10014 9.99 0.0 True
9364 4.99 0.0 True
35817 0.00 0.0 True
11214 4.99 0.0 True
11441 9.99 0.0 True
17624 4.99 0.0 True
12938 4.99 0.0 True
9365 4.99 0.0 True
<---the 10 earliest games on steam --->
title
Carmageddon Max Pack
POSTAL
Half-Life
Team Fortress Classic
Legacy of Kain: Soul Reaver
Half-Life: Opposing Force
Counter-Strike
Ricochet
Half-Life: Blue Shift
Deathmatch Classic
just the title of the top 10 games
title
Counter-Strike: Global Offensive
PUBG: BATTLEGROUNDS
Dota 2
Grand Theft Auto V
Tom Clancy's Rainbow Six® Siege
Team Fortress 2
Terraria
Garry's Mod
Rust
The Witcher® 3: Wild Hunt