Using SQLite within Python to create database and analyze Starcraft 2 units data (Pandas also used)

Overview

SQLite python Starcraft 2

English

This project shows the usage of SQLite with python.

To create, modify and communicate with the SQLite database from within python I'll use the SQLite3 library that comes by default with python.

The content of the database I'll be working on will be statistics of the units from the Starcraft 2 game. Reason being that working with some mock data is not that interesting to me, so in order to keep it more interesting and not just create dummy 'customer' or 'celebrity' tables I will create a table where I INSERT few of the terran units with simplified stats.

Starcraft 2 is an RTS (Real Time Strategy) game, where the commander(player) controls various kinds of units. The goal of the game is to build attacking units to destroy all of the opponents buildings. To achieve that goal one can improve one's economy by creating more workers and expand to more bases. That's where statistics of the units come into play. The damage, speed, etc. of each unit has profound effect on the game and that's what I want to explore.

There are several jupyter notebooks that either do the actual SQL modifications or perform tasks that are needed for the SQL work (like spraping page of liquipedia using pandas and 'exporting' it to a SQLite database).

Here is the description of what do I actually do in each notebook.

SQLite_basic_operations_SC2units.ipynb

Here I create some close to real data for Starcraft 2 terran units. I create a database and enter 4 rows each corresponding to one unit type, with 5 columns, including name and excluding rowid. In reality terran race in Starcraft 2 has about 23 units (depends on what you actually count as a unit or as a building) and each unit has close to 20 characterists, depending on race (which boil down to columns in a Starcraft 2 game).

This mock data is saved in the data/sc2_basic_units.db file.

Here I want to show basic SQL skills that are most basic and most commonly used but the data is mock data (even though it's based on real data). In this notebook I'm not exploring or solving any real problem. Just basic SQL stuff :)

units_sc2_scraping.ipynb

Here I scrape data from the Liquipedia website section with all the data about Starcraft 2 units. Liquipedia is one of the best encyclopedias about Starcraft franchise and other esport games. Below is the exact address of the scraped page: https://liquipedia.net/starcraft2/Unit_Statistics_(Legacy_of_the_Void)

The data is saved in the sc2_data.db. Here the goal is just to get the data of the webpage and save it to the database. I'll actually work on the data in the next notebook.

Polski

Starcraft 2 jest grą RTS (Strategia czasu rzeczywistego) gdzie gracz zarządza jedną z trzech ras. Celem gry jest wytrenowanie jednostek atakujących w celu zniczszenia budynków przeciwnika. Gracz może zwiększyć swoje zasoby poprzez tworzenie więcej jednostek zbierających zasoby i rozbudowania swojej bazy. W tym zeszycie będę dodawał wiersze do tabeli terran_units odpowiadające uproszczonym statystykom 4 jednostek terrana.

You might also like...
Domain Connectivity Analysis Tools to analyze aggregate connectivity patterns across a set of domains during security investigations
Domain Connectivity Analysis Tools to analyze aggregate connectivity patterns across a set of domains during security investigations

DomainCAT (Domain Connectivity Analysis Tool) Domain Connectivity Analysis Tool is used to analyze aggregate connectivity patterns across a set of dom

Interactive plotting for Pandas using Vega-Lite
Interactive plotting for Pandas using Vega-Lite

pdvega: Vega-Lite plotting for Pandas Dataframes pdvega is a library that allows you to quickly create interactive Vega-Lite plots from Pandas datafra

Interactive plotting for Pandas using Vega-Lite
Interactive plotting for Pandas using Vega-Lite

pdvega: Vega-Lite plotting for Pandas Dataframes pdvega is a library that allows you to quickly create interactive Vega-Lite plots from Pandas datafra

Draw datasets from within Jupyter.
Draw datasets from within Jupyter.

drawdata This small python app allows you to draw a dataset in a jupyter notebook. This should be very useful when teaching machine learning algorithm

Script to create an animated data visualisation for categorical timeseries data - GIF choropleth map with annotations.
Script to create an animated data visualisation for categorical timeseries data - GIF choropleth map with annotations.

choropleth_ldn Simple script to create a chloropleth map of London with categorical timeseries data. The script in main.py creates a gif of the most f

Python scripts to manage Chia plots and drive space, providing full reports. Also monitors the number of chia coins you have.
Python scripts to manage Chia plots and drive space, providing full reports. Also monitors the number of chia coins you have.

Chia Plot, Drive Manager & Coin Monitor (V0.5 - April 20th, 2021) Multi Server Chia Plot and Drive Management Solution Be sure to ⭐ my repo so you can

Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:
Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:

JoyPy JoyPy is a one-function Python package based on matplotlib + pandas with a single purpose: drawing joyplots (a.k.a. ridgeline plots). The code f

Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:
Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:

JoyPy JoyPy is a one-function Python package based on matplotlib + pandas with a single purpose: drawing joyplots (a.k.a. ridgeline plots). The code f

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

Owner
null
A program that analyzes data from inertia measurement units installed in aircraft and generates g-exceedance curves.

A program that analyzes data from inertia measurement units installed in aircraft and generates g-exceedance curves.

Pooya 1 Dec 2, 2021
In-memory Graph Database and Knowledge Graph with Natural Language Interface, compatible with Pandas

CogniPy for Pandas - In-memory Graph Database and Knowledge Graph with Natural Language Interface Whats in the box Reasoning, exploration of RDF/OWL,

Cognitum Octopus 34 Dec 13, 2022
Create HTML profiling reports from pandas DataFrame objects

Pandas Profiling Documentation | Slack | Stack Overflow Generates profile reports from a pandas DataFrame. The pandas df.describe() function is great

null 10k Jan 1, 2023
Create HTML profiling reports from pandas DataFrame objects

Pandas Profiling Documentation | Slack | Stack Overflow Generates profile reports from a pandas DataFrame. The pandas df.describe() function is great

null 6.8k Feb 18, 2021
The windML framework provides an easy-to-use access to wind data sources within the Python world, building upon numpy, scipy, sklearn, and matplotlib. Renewable Wind Energy, Forecasting, Prediction

windml Build status : The importance of wind in smart grids with a large number of renewable energy resources is increasing. With the growing infrastr

Computational Intelligence Group 125 Dec 24, 2022
NumPy and Pandas interface to Big Data

Blaze translates a subset of modified NumPy and Pandas-like syntax to databases and other computing systems. Blaze allows Python users a familiar inte

Blaze 3.1k Jan 1, 2023
Farhad Davaripour, Ph.D. 1 Jan 5, 2022
Project coded in Python using Pandas to look at changes in chase% for batters facing a pitcher first time through the order vs. thrid time

Project coded in Python using Pandas to look at changes in chase% for batters facing a pitcher first time through the order vs. thrid time

Jason Kraynak 1 Jan 7, 2022
Visualize your pandas data with one-line code

PandasEcharts 简介 基于pandas和pyecharts的可视化工具 安装 pip 安装 $ pip install pandasecharts 源码安装 $ git clone https://github.com/gamersover/pandasecharts $ cd pand

陈华杰 2 Apr 13, 2022
Calendar heatmaps from Pandas time series data

Note: See MarvinT/calmap for the maintained version of the project. That is also the version that gets published to PyPI and it has received several f

Martijn Vermaat 195 Dec 22, 2022