Skip to content

Instantly share code, notes, and snippets.

View knnkanda's full-sized avatar

Paul Kanda Toshiaki knnkanda

View GitHub Profile
@knnkanda
knnkanda / seirekika.js
Created January 21, 2017 12:08
【和暦→西暦ブックマークレット】
javascript:(function(){o=document.getElementsByTagName('body')[0];s=o.innerHTML;s=s.replace(/元年/g,'1年');g='寛保,延享,寛延,宝暦,明和,安永,天明,寛政,享和,文化,文政,天保,弘化,嘉永,安政,万延,文久,元治,慶応,明治,大正,昭和,平成'.split(',');ys=[1740,1743,1747,1750,1763,1771,1780,1788,1800,1803,1817,1829,1843,1847,1853,1859,1860,1863,1864,1867,1911,1925,1988];r=new RegExp('('+g.join('|')+')([0-9]+)年','g');s=s.replace(r,function($0,$1,$2){for(i=0;i<g.length;i++){if($1==g[i]){yz=ys[i];}}return($1+$2+'年('+(parseInt($2)+parseInt(yz))+'年)')});o.innerHTML=s;})()
@knnkanda
knnkanda / python3 install
Created February 25, 2018 11:04
python3 install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
[pieChart title="KNN部門別売上シェア"]
['knn', 'sales'],
['ライティング部門',100],
['コンサル部門',300],
['ウェブサービス部門',100],
['投資部門',100],
['シェアリング部門',300][/pieChart]
[pieChart title="Apple 2015 QY1"]
['Apple', 'sales'],
['iPhone',51182],
['iPad',8985],
['Mac',6944],
['Services',4799],
['Other Products',2689],[/pieChart]
[pieChart title="日本の広告費2017年 出典:電通"]
['媒体', '売上'],
['インターネット',15094],
['テレビ',19478],
['新聞',5147],
['雑誌',2023],
['ラジオ',1290],
['屋外',3208],
['交通',2002],
['折込',3701],
@knnkanda
knnkanda / apple marketcap.ipynb
Last active March 18, 2018 06:58
20180318bs4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knnkanda
knnkanda / 20180318Python_programing.ipynb
Created March 18, 2018 07:37
Bloombergデータのスクレイピング方法
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knnkanda
knnkanda / calendar month
Created April 1, 2018 09:29
python3 jupyter notebook calendar month
import calendar
tc= calendar.TextCalendar(firstweekday=0)
print(tc.prmonth(2018, 4))
@knnkanda
knnkanda / csv from
Last active April 1, 2018 09:55
from csv population
import pandas as pd
pd.read_csv("population.csv")
@knnkanda
knnkanda / %matplotlib inline
Created April 1, 2018 10:30
bar chart matplotlib
%matplotlib inline
# グラフ化
import pandas as pd
# pandasを pdに入れる
df = pd.read_csv("population.csv")
#pdの結果をdfに入れる
df.plot.bar(y=["2016"],x=["prefecture"])
#dfをbarチャートでプロット、x縦軸に人数 Y横軸に都市名を入れる