Skip to content

Instantly share code, notes, and snippets.

@geojackass
geojackass / swim_startlist2020.py
Last active September 21, 2021 14:03
全中水泳2020
import tabula
import pandas as pd
df = tabula.read_pdf("dir/to/path", pages='all')
#PDFが複数枚になる場合に,複数のテーブルに分割される場合,indexをインクリメントする
df0 = df[0].rename(columns={"水路":"suiro", "加 盟":"kamei","Unnamed: 0":"num","氏 名":"name","Unnamed: 1":"kana","所属名":"school","Unnamed: 2":"school_kana","学年":"grade"}).dropna(how='any')
df0 = df0.loc[:,["suiro","kamei","name","school","grade"]]
df0.head()
df1 = df[1].rename(columns={"水路":"suiro", "加 盟":"kamei","Unnamed: 0":"num","氏 名":"name","Unnamed: 1":"kana","所属名":"school","Unnamed: 2":"school_kana","学年":"grade"}).dropna(how='any')
@geojackass
geojackass / knapsack.ipynb
Created February 5, 2021 16:58
knapsack.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geojackass
geojackass / anomaly_score.R
Last active October 8, 2020 16:23
製品データの異常度に基づく異常値の算出
#####initial setup######
########################
pacman::p_load(tidyverse, magrittr, stringr)
########################
df <- read.csv('{dir_path}')
#データの確認
head(df)
#データサイズの確認
dim(df)
@geojackass
geojackass / order_forecast.ipynb
Created September 20, 2020 11:03
order_forecast.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geojackass
geojackass / thk_stock_price.ipynb
Created September 19, 2020 16:16
thk_stock_price.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geojackass
geojackass / homeless_data_reshape.R
Last active May 6, 2020 16:01
ホームレスデータの整形を行う.ExcelをRで扱う練習
##############initial setup################
getwd()
lib_pth <- getwd()
print(lib_pth)
#install.packages("tidyverse", lib=lib_pth)
#install.packages("pacman", lib=lib_pth)
#install.packages("stringr", lib=lib_pth)
#install.packages("magrittr", lib=lib_pth)
#install.packages("dplyr", lib=lib_pth)
#install.packages("readxl", lib=lib_pth)
@geojackass
geojackass / get_mhlw.R
Last active April 30, 2020 15:24
死因(死因年次推移分類)別にみた性・年次別死亡数及び死亡率(人口10万対)
##############initial setup################
getwd()
lib_pth <- getwd()
print(lib_pth)
#install.packages("tidyverse", lib=lib_pth)
#install.packages("pacman", lib=lib_pth)
#install.packages("stringr", lib=lib_pth)
#install.packages("magrittr", lib=lib_pth)
#install.packages("estatapi", lib=lib_pth)
############################################
@geojackass
geojackass / get_labor_data.R
Last active April 30, 2020 15:17
e-StatAPIから雇用に関するデータを抽出する
##############initial setup################
getwd()
lib_pth <- getwd()
print(lib_pth)
#install.packages("tidyverse", lib=lib_pth)
#install.packages("pacman", lib=lib_pth)
#install.packages("stringr", lib=lib_pth)
#install.packages("magrittr", lib=lib_pth)
#install.packages("estatapi", lib=lib_pth)
############################################
@geojackass
geojackass / 食べログEDA.md
Created October 15, 2019 14:35 — forked from GINK03/食べログEDA.md
食べログEDA

食べログEDA

3.6点の壁は本当にあるのか

スクレイピングのコード

import os
import sys
@geojackass
geojackass / jupyter_notebook_config.py
Created March 4, 2018 12:24
jupyter_notebookをサーバーサイドで使用する場合のconfig
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'