Skip to content

Instantly share code, notes, and snippets.

@allieus
Created October 8, 2025 14:50
Show Gist options
  • Save allieus/1bccc34e941dc783ab2144bc3b8367a5 to your computer and use it in GitHub Desktop.
Save allieus/1bccc34e941dc783ab2144bc3b8367a5 to your computer and use it in GitHub Desktop.
ABC부트캠프 Python 강의 - 게임 판매 샘플 데이터 생성
# ABC부트캠프 Python 강의 - 샘플 게임 판매 데이터 생성
# 글로벌 게임 판매 데이터 (Top 50)
import pandas as pd
# 샘플 게임 판매 데이터
data = {
"Rank": list(range(1, 51)),
"게임명": [
"Minecraft", "Grand Theft Auto V", "Tetris (EA)", "Wii Sports", "PUBG: Battlegrounds",
"Super Mario Bros.", "Mario Kart 8", "Red Dead Redemption 2", "Pokémon Red/Blue/Yellow", "Terraria",
"The Witcher 3", "Wii Fit", "Pac-Man", "Animal Crossing: New Horizons", "Overwatch",
"Diablo III", "The Elder Scrolls V: Skyrim", "Call of Duty: Modern Warfare", "Super Mario World", "Pokémon Gold/Silver",
"Wii Sports Resort", "New Super Mario Bros.", "Call of Duty: Black Ops", "Duck Hunt", "Wii Play",
"Pokémon Sun/Moon", "Call of Duty: Black Ops II", "Borderlands 2", "Pokémon Diamond/Pearl", "Pokémon Sword/Shield",
"Super Smash Bros. Ultimate", "Lego Star Wars: The Complete Saga", "Grand Theft Auto: San Andreas", "Super Mario Bros. 3", "Call of Duty: Modern Warfare 3",
"New Super Mario Bros. Wii", "Call of Duty: Black Ops III", "The Legend of Zelda: Breath of the Wild", "Super Mario 64", "Pokémon Ruby/Sapphire",
"Call of Duty: Ghosts", "Red Dead Redemption", "Halo 3", "Super Mario Galaxy", "Pokémon X/Y",
"Call of Duty: WWII", "Minecraft: Story Mode", "Super Mario Odyssey", "Destiny", "League of Legends"
],
"플랫폼": [
"Multi-platform", "Multi-platform", "Mobile", "Wii", "PC",
"NES", "Switch", "Multi-platform", "GB", "PC",
"Multi-platform", "Wii", "Multi-platform", "Switch", "PC",
"PC", "Multi-platform", "Multi-platform", "SNES", "GB",
"Wii", "DS", "Multi-platform", "NES", "Wii",
"3DS", "Multi-platform", "Multi-platform", "DS", "Switch",
"Switch", "Multi-platform", "PS2", "NES", "Multi-platform",
"Wii", "Multi-platform", "Switch", "N64", "GBA",
"Multi-platform", "Multi-platform", "X360", "Wii", "3DS",
"Multi-platform", "Multi-platform", "Switch", "Multi-platform", "PC"
],
"발행년도": [
2011, 2013, 2006, 2006, 2017,
1985, 2017, 2018, 1996, 2011,
2015, 2007, 1980, 2020, 2016,
2012, 2011, 2019, 1990, 1999,
2009, 2006, 2010, 1984, 2006,
2016, 2012, 2012, 2006, 2019,
2018, 2007, 2004, 1988, 2011,
2009, 2015, 2017, 1996, 2002,
2013, 2010, 2007, 2007, 2013,
2017, 2015, 2017, 2014, 2009
],
"장르": [
"Sandbox", "Action", "Puzzle", "Sports", "Shooter",
"Platform", "Racing", "Action", "RPG", "Sandbox",
"RPG", "Sports", "Puzzle", "Simulation", "Shooter",
"RPG", "RPG", "Shooter", "Platform", "RPG",
"Sports", "Platform", "Shooter", "Shooter", "Sports",
"RPG", "Shooter", "Shooter", "RPG", "RPG",
"Fighting", "Action", "Action", "Platform", "Shooter",
"Platform", "Shooter", "Action", "Platform", "RPG",
"Shooter", "Action", "Shooter", "Platform", "RPG",
"Shooter", "Adventure", "Platform", "Shooter", "MOBA"
],
"배급사": [
"Mojang", "Rockstar Games", "Electronic Arts", "Nintendo", "PUBG Corporation",
"Nintendo", "Nintendo", "Rockstar Games", "Nintendo", "Re-Logic",
"CD Projekt", "Nintendo", "Namco", "Nintendo", "Blizzard",
"Blizzard", "Bethesda", "Activision", "Nintendo", "Nintendo",
"Nintendo", "Nintendo", "Activision", "Nintendo", "Nintendo",
"Nintendo", "Activision", "2K Games", "Nintendo", "Nintendo",
"Nintendo", "LucasArts", "Rockstar Games", "Nintendo", "Activision",
"Nintendo", "Activision", "Nintendo", "Nintendo", "Nintendo",
"Activision", "Rockstar Games", "Microsoft", "Nintendo", "Nintendo",
"Activision", "Telltale Games", "Nintendo", "Activision", "Riot Games"
],
"판매량_백만": [
238.0, 185.0, 100.0, 82.9, 75.0,
58.0, 55.5, 50.0, 47.5, 44.5,
40.0, 43.0, 42.0, 42.8, 50.0,
30.0, 30.0, 30.0, 20.6, 23.1,
33.1, 30.8, 30.7, 28.3, 28.0,
25.5, 29.0, 13.0, 17.7, 24.3,
28.8, 15.8, 20.8, 18.0, 28.5,
30.3, 26.7, 28.3, 11.9, 16.2,
28.1, 15.0, 14.5, 12.8, 16.6,
19.0, 5.7, 23.9, 20.0, 100.0
]
}
# DataFrame 생성
df = pd.DataFrame(data)
# Excel 파일로 저장
excel_path = "/tmp/game_sales_data.xlsx"
df.to_excel(excel_path, index=False, sheet_name="게임판매데이터")
print(f"✅ 샘플 데이터 생성 완료: {excel_path}")
print(f"📊 총 {len(df)}개 게임 데이터")
print("\n미리보기:")
print(df.head(10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment