Standardized NK (NPB & KBO) baseball datasets with pandas loaders. Includes MLB players who appeared in NPB/KBO.
Project description
NK_datasets
NK_datasets ships standardized datasets for NPB (Nippon Professional Baseball) and KBO (Korea Baseball Organization), packaged with pandas loaders.
It also includes MLB players who have played in either NPB, KBO, or both.
- NPB data was scraped from the official NPB website and npbstats.com.
- KBO data was scraped from the official KBO website.
- MLB alignment is partial; meaning only players who appeared in KBO/NPB are included. It was sourced from Lahman Database.
Requirements
- Python 3.9+
- pandas 1.5+
Install
pip install nk_datasets
Import
import nk
All Datasets are grouped into the following collections:
-
kbo_npb – KBO/NPB league tables:
load_kbo_batting(),load_kbo_pitching(),load_kbo_fielding(),load_kbo_people()``load_npb_batting(),load_npb_pitching(),load_npb_fielding(),load_npb_people() -
kbo_npb_mlb – KBO/NPB/MLB league tables with aligned columns for direct comparison across all 3 leagues:
load_kbo_batting_aligned(),load_kbo_pitching_aligned(),load_kbo_fielding_aligned(),load_kbo_people_aligned(),load_npb_batting_aligned(),load_npb_pitching_aligned(),load_npb_fielding_aligned(),load_npb_people_aligned(),load_mlb_batting_aligned(),load_mlb_pitching_aligned(),load_mlb_fielding_aligned(),load_mlb_people_aligned() -
nk_merged – "wide" merged tables (combined schema across KBO and NPB):
load_nk_batting(),load_nk_pitching(),load_nk_fielding(),load_nk_people(),load_nk_league(),load_nk_team(),load_nk_merged_people() -
nk_merged_tall – "tall" player stats, split by league/data slice:
load_nk_playerstats_KBO(),load_nk_playerstats_PL(),load_nk_playerstats_CL(),load_nk_playerstats_JBL(),load_nk_league(),load_nk_team(),load_nk_stats()
Short Snippet
import nk
# load nk_merged batting table
df = nk.load_nk_batting()
# show first rows
print(df.head())
License
MIT License © Myungkeun Park
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nk_datasets-0.1.1.tar.gz.
File metadata
- Download URL: nk_datasets-0.1.1.tar.gz
- Upload date:
- Size: 34.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db6e73a3759667e6fbd8297dded68e8ad0cf94081842fd1ea22ce982cd23d5a7
|
|
| MD5 |
00781d4eb332b7e443319f7e8ede9979
|
|
| BLAKE2b-256 |
ab04ed1689a6ea46cae4ab0538f7aced013602a52ebbf61a61b55102c7facb68
|
File details
Details for the file nk_datasets-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nk_datasets-0.1.1-py3-none-any.whl
- Upload date:
- Size: 36.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48bbca738051fa5e7e15e8bf4a98eab3a4ee82fd8e581fafa048901fe04274dc
|
|
| MD5 |
134827373b95667633e2bf99d52007b8
|
|
| BLAKE2b-256 |
7bb1882602844dab0fd2b559cad40bf51cce4a820834716357bceebb56c57fd7
|