import os
import sys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#####initial setup###### | |
######################## | |
pacman::p_load(tidyverse, magrittr, stringr) | |
######################## | |
df <- read.csv('{dir_path}') | |
#データの確認 | |
head(df) | |
#データサイズの確認 | |
dim(df) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##############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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##############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) | |
############################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##############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) | |
############################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
NewerOlder