pandas(timestamp,groupby)メモ
import pandas as pd df=pd.read_csv("./data/hoge.csv") print(df) df["TIMESTAMP"]=pd.to_datetime(df["DATE"]) print(df["TIMESTAMP"].dt.year) print(df["TIMESTAMP"].dt.month) print(df["TIMESTAMP"].dt.weekday_name)
import pandas as pd df=pd.read_csv("./data/hoge.csv") print(df) for name, grouped_df in df.groupby("DATE"): print("") print("###",name) print(grouped_df)
pyplotメモ
import pandas as pd import matplotlib import matplotlib.pyplot as plt ### pyplot setting plt.style.use('ggplot') font = {'family' : 'meiryo'} matplotlib.rc('font', **font) plt.rcParams["figure.figsize"] = [10,10] ### pyplot initialize #fig = plt.figure() row1=list(range(0,5)) row2=list(range(5,10)) row3=list(range(10,15)) df=pd.DataFrame([row1,row2,row3],columns=["kokugo","sansu","rika","shakai","eigo"],index=["111","222","333"]) print(df) ### 列抽出 print("###列抽出") print(df["sansu"]) print(df[["sansu","shakai"]]) ### 行抽出 print("###行抽出") print(df[1:3]) print(df[(df["sansu"]==1)]) ### 行列 print("###sell抽出") print(df.at["222","sansu"]) print(df.iat[1,1]) df.plot.bar(alpha=0.6) plt.title("bargraph") plt.savefig("./res/bar.png") df.plot.bar(alpha=0.6,stacked=True) plt.title("stackgraph") plt.savefig("./res/stack.png") df.plot(alpha=0.6) plt.title("plot") plt.savefig("./res/plot.png") df.plot(alpha=0.6,kind="hist") plt.title("histgram") plt.savefig("./res/histgram.png") df.plot(alpha=0.6,kind="area") plt.title("area") plt.savefig("./res/area.png") df.plot(x="kokugo",y="sansu",alpha=0.6,kind="scatter") plt.title("scatter") plt.savefig("./res/scatter.png") df.hist() plt.title("allhist") plt.savefig("./res/allhist.png")
参考
鍵の種類のまとめ
種別
KEY
- Private Key
- 秘密鍵
CSR
- Certificate Signing Request
- 公開鍵
- KEYより作成
CRT
nginx設定
- sites-available/default
server { # SSL configuration # listen 443 ssl default_server; listen [::]:443 ssl default_server; server_name www.example.jp; #ssl on; ssl_certificate /wks/authkey/combined.crt ; ssl_password_file /wks/authkey/ssl.key/pass.txt; ssl_certificate_key /wks/authkey/ssl.key/server.key; ssl_session_timeout 2m; #ssl_protocols TLSv1; root /var/www/html; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name _; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } }
- conf.d/default.conf
server{ listen 50000 ; listen [::]:50000 ; root /wks/html; # Add index.php to the list if you are using PHP #index index.html index.htm index.nginx-debian.html; server_name _; #server_name www.example.jp; ssl on; ssl_certificate /wks/authkey/combined.crt ; ssl_password_file /wks/authkey/ssl.key/pass.txt; ssl_certificate_key /wks/authkey/ssl.key/server.key; ssl_session_timeout 2m; server_name _; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } }
rescueモードでの起動
ubuntuとwindows10のデュアルブートマシンを開発に使用しているが windowsupdateの関係でubuntuが起動しなくなり、どえらい目にあったのでメモ。
基本は以下に従った
grub rescueと表示されるdual bootパソコンを復旧させる方法 - ShinobiMind
grub/i386-pc/normal.modがどこにあるかを探し、 prefix,rootに指定しnormalを実行する
普段ブートしているハードを選び、再インストール WM×LI: grub rescue が表示されても慌てずに.
ポートが使用できない時のメモ
thunder lock: disabled (you can enable it with --thunder-lock) probably another instance of uWSGI is running on the same address (0.0.0.0:50001). bind(): Address already in use [core/socket.c line 769]
- 以下コマンドで解決
fuser -k 50001/tcp
gitでtagをつける
tagのつけかた
git tag -a release_1.0 -m 'first release' commitidxxxxxxxxxxxxxxxxxxxxxxxxxxxxx git push origin release_1.0
tagの取り出し
git checkout -b release_1.0 refs/tags/release_1.0
参考
pythonにおけるmultiprocessingでの変数受け渡し
マルチプロセス間で変数を受け渡しするときにハマったのでメモ
- 引越しました