Skip to content

Instantly share code, notes, and snippets.

@ishidur
ishidur / config.py
Last active August 23, 2018 08:47
Pythonで画像からGIFを生成 #code
# config
class GifMakerConfig:
__path = './results/'
__problem_set = 'random_30_cities/'
__en_path = 'elastic_nets/'
__som_path = 'self_organizing_map/'
source_dir = __path + __problem_set + __en_path
@ishidur
ishidur / sigmoid.py
Last active August 23, 2018 08:47
PythonでSigmoid関数を描画 #code
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'sans-serif' # 使用するフォント
# x軸の目盛線が内向き('in')か外向き('out')か双方向か('inout')
plt.rcParams['xtick.direction'] = 'in'
# y軸の目盛線が内向き('in')か外向き('out')か双方向か('inout')
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['xtick.major.width'] = 1.0 # x軸主目盛り線の線幅
plt.rcParams['ytick.major.width'] = 1.0 # y軸主目盛り線の線幅
@ishidur
ishidur / webscraper.py
Last active September 10, 2018 13:51
Pythonで歴代総長をWebスクレイピング #code
import requests
from bs4 import BeautifulSoup
import csv
if __name__ == '__main__':
csvFile = open("ut_soutyou.csv", 'w', encoding='utf-8_sig', newline='')
writer = csv.writer(csvFile)
target_url = "http://www.u-tokyo.ac.jp/gen01/b01_03_j.html"
# target_url = "http://www.ynu.ac.jp/about/president/successive.html"
@ishidur
ishidur / pandas-plot.py
Last active August 23, 2018 08:48
Pandasを使ってグラフを作成 #code
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import re
import glob
plt.rcParams['font.family'] = 'sans-serif' # 使用するフォント
# x軸の目盛線が内向き('in')か外向き('out')か双方向か('inout')
plt.rcParams['xtick.direction'] = 'in'
# y軸の目盛線が内向き('in')か外向き('out')か双方向か('inout')
plt.rcParams['ytick.direction'] = 'in'
@ishidur
ishidur / annotation.py
Last active April 11, 2021 06:34
Pythonで有意差の注記を追加するプログラム #code
import numpy as np
import matplotlib.pyplot as plt
menMeans = (5, 15, 30, 40)
menStd = (2, 3, 4, 5)
ind = np.arange(4) # the x locations for the groups
width = 0.7
labels = ('A', 'B', 'C', 'D')
# Pull the formatting out here
bar_kwargs = {'width': width, 'color': 'y', 'linewidth': 2, 'zorder': 5}
@ishidur
ishidur / functionplot.py
Last active August 23, 2018 08:48
Pythonによる関数の描画 #code
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'sans-serif' # 使用するフォント
# x軸の目盛線が内向き('in')か外向き('out')か双方向か('inout')
plt.rcParams['xtick.direction'] = 'in'
# y軸の目盛線が内向き('in')か外向き('out')か双方向か('inout')
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['xtick.major.width'] = 1.0 # x軸主目盛り線の線幅
plt.rcParams['ytick.major.width'] = 1.0 # y軸主目盛り線の線幅
plt.rcParams['font.size'] = 8 # フォントの大きさ
@ishidur
ishidur / subl-mac.md
Last active September 11, 2018 03:22
my sublime settings #settings #macos #windows
@ishidur
ishidur / homebrew.md
Last active September 22, 2018 01:32
macのパッケージ管理関連のコマンド #package_manager #macos #shell

homebrew

Official site: brew.sh/

TL;DR:

brew update && brew upgrade && brew cleanup

homebrew自体を更新

brew update
@ishidur
ishidur / ubuntu_command.md
Last active October 6, 2018 10:50
ubuntu周りのコマンド #package_manager #ubuntu #shell

update関連

TR;DR

sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade && sudo apt -y autoremove && sudo apt -y autoclean

最新のアップデートを確認

sudo apt update

確認した最新のアップデートを適用

@ishidur
ishidur / latex_win.md
Last active December 24, 2020 00:26
WindowsでLatex環境を設定する #settings #windows