
DFカラム並べ替え
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | df例 '''     a   b   c    A   0   1   2    S   5   6   7    ''' 並べ替え df.loc[:,['a','c','b']] '''     a   c   b    A   0   2   1 S   5   7   6 | 
DFカラムを複数削除する
| 1 2 3 4 5 | to_remove = [1,2,'Classification','Period Desc."','Aggregate Level','Is Leaf Code','Trade Flow Code','Reporter Code',              'Partner Code','Partner','Partner ISO','2nd Partner Code','2nd Partner','2nd Partner ISO','Customs Proc. Code',              'Customs','Mode of Transport Code"','Mode of Transport','Commodity Code','Commodity','Qty Unit Code','Flag','value/unit',             'CIF Trade Value (US$)','FOB Trade Value (US$)','Gross weight (kg)','Mode of Transport Code','','',''] df = df[df.columns.difference(to_remove)] | 
PythonでxserverにFTPアップロード
pythonファイルと同じディレクトリにあるhtmlファイルをすべて
ftpアップロードするコード
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | import glob import string import os from ftplib import FTP import urllib.request filelist=glob.glob('*.html') ftp=FTP('sv2142.xserver.jp') ftp.set_pasv("true") ftp.login('ここにID','ここにパスワード') ftp.cwd('/aaaa.com/public_html/bbb/') #ホスト側のディレクトリ for file in filelist: #     f=open(file,'rb')     with open(file, "rb") as f:         filename=os.path.basename(file)         cmd='STOR '+filename         ftp.storbinary(cmd,f)         f.close() ftp.quit() for file in filelist:     os.remove(file) | 
GenesisにBodyClassを追加する
| 1 2 3 4 5 6 7 8 9 | // sample-categoryというカテゴリスラッグを持つページにBody Classを追加 add_filter( 'body_class', 'sp_body_class' ); function sp_body_class( $classes ) {     if ( is_category( 'sample-category' ) )         $classes[] = 'custom-class';         return $classes; } | 
(CSS設定)統計グラフを左右にストレッチ表示
Wordpressのダッシュボードの外観→カスタマイズ→追加css
で以下のコードを追記する
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | @media only screen and (min-width: 960px){ 	.full-width-content.full-containar .content{ 		width:100%; 	} 	.full-width-content.full-containar .site-inner{ 		max-width:100%; 	} 	.full-width-content.full-containar .breadcrumb, .full-width-content.full-containar .entry-header, .full-width-content.full-containar .center-block, .full-width-content.full-containar .yarpp-related, .full-width-content.full-containar .entry-footer, .full-width-content.full-containar .comment-respond, .full-width-content.full-containar .after-entry{ 		max-width:700px; 		margin-left:auto; 		margin-right:auto; 	}	 } | 
このCSSを投稿画面で全幅レイアウトを選び、
「Custom Body Class」に「full-containar」と入力
投稿画面のhtmlは下記のように入力
| 1 2 3 4 5 6 | <div class="center-block"> 中央に寄せたい本文をここに入力 100%のグラフはこのブロックの外側に入力 </div> |