Search this site
Skip to main content
Skip to navigation
Python Tips & Memos by Physical Oceanography & Climate Laboratory in Hokkaido University
Home
exercises
1. 基礎問題
2. numpy 問題
3. クラス問題
numpy answers
! Tips
%debug
* CDO
* climateでのpython3.6の実行環境設定
* debugの基礎,basic debug
* generate a function with axis= option
* getting started on climate
* nco
opendap データのダウンロード
* useful linux commands
16GB barrier on climate
cronを使った自動実行
Dr Miyama's python info summary
edit through winscp
end notification via line
gif animation (movie)
ipython -i vs jupyter notebook
map figure for unstructured grid with nan
multi-step script naming
path setting
python call from python
python in NCAR
pythonの本
robocopy (windows)
script execution
スクリプトをpython 2, 3 の両方で動くようにする Make script working both for python 2 & 3
多数の結果を効果的に作り出すProduce large amount of result effectively
特定ディレクトリ以下の特定ファイル名取得
複数設定の計算 multiple settings calc
高速化(基礎)
高速化(高度)
list comprehension リスト内包表記
monthly anomaly
Packages
mambaforge
Cartopy
add_cyclic_point
axの設定
clipping reagional figures
plot, 注意caution
set_extent
ticker
tripcolor
Hovmollor diagram with Cartopy
conda
annaconda, windows
creat or add modula
py2.7 on climate
py3.6 on climate
py3.8 on climate
python 2.7 on Ubuntu 12.04.5 LTS
python 3.7 on ocean
windows10 + linux subsystem
win11 + linux + pyenv + conda + python
datetime
strptime()
dill
eofs
with iris
with xarray
glob
gsw
sigma
Iris
cube
cube to ma
extract
interpolate
necdfの読み込み reading netcdf
netcdfの書き出し write to netcdf
np arrayと座標をcubeに np array & coord to cube
quickplot
regrid
下位パッケージ sub-packeges
季節平均の計算 seasonal average
matplotlib
axes_grid1
basemap
draw across zonal boundary
drawmeridians
drawparallels
pcolor (tri=True)
colors
BoundaryNorm
LinearSegmentedColormap
MidpointNormalize
pyplot
add_axes
annotate
axes
boxplot
contourf
figure
ion/ioff
labels
legend
pcolor, pcolorfast, pcolormesh
plot
savefig
set_ylim
style sheet
style sheet
subplot
subplots_adjust
text
twinx
x(y)ticks
ticker
tri
zorder
subplot2grid
get_cmap
multiprocessing
netcdf4
numba
NumPy
argmin
argsort
array generation
broadcast
copy
delete
dtype
empty
eye
fft
flipud fliplr
functions for nan
isnan
loadtxt
masked array
ma.average
matrix vs array
percentile
random number
ravel
running ave
save & load
searchsorted
shape
squeeze
statistics funcs
std
tofile & fromfile
transpose
type change
vstack, hstack
where
論理演算
os
chdir
getcwd
listdir
makedirs
path.isfile etc
path.join
path.split
sep
stat
walk
pandas
DataFrame
datetime
read_csv
read_excel
time range limitation
pdb (debugger)
pickle
py3grads
basic sample
OPenDAP
read data with time
pygrads
basics
opendap
pygrib
grib-api install to climate
pygrib insall Ubuntu12
pyNio
get vars names
scikit-learn
normalize
pca
svm
SciPy
detrend
multi-regression
SciPy or NumPy
scipy.ndimage.convolve1d
signal.butter
signal.freqz
stats.zscore (normalize)
seaborn
stripplot
shapely
spectrum
statsmodels
sys
path.append
time
sleep
warning
xarray
*make coords for xr.dataarray
average (DJF)
average (running)
average (simple)
climatology & anomaly
ensemble output 4 grads
mean
open_dataset, open_mfdataset
sel: read selected range
squeeze
time attribution
to_netcdf
units
yr<1678, 2262<yr problem
expand_dims
resample
to_csv
LeaveOneOut
read nc file
クラス class
定義の基本 basic definition
属性一覧
属性有無 check attribution
ファイル File
read binary file
あるディレクトリ以下のファイル列挙
ディレクトリ作成
ファイルに文字列の書き出し
ファイルの拡張子を取得
ファイルコピー
ファイル名検索(1ディレクトリ)
フルパスからディレクトリ名とファイル名を取得
フルパスからファイル名を取得
1行づつファイルから読む
ファイルかディレクトリかリンクかを調べる
リスト Lists
スライス slice
リストかどうか Is it list?
リストの追加,延長,連結
リストの長さの取得
リストを文字列に list to string
リスト作成
並べ替え sort
基礎 Basics
Comments
for
if 文,if statement
Quick Reference (ext link)
run python script
whos
with
エラーメッセージ error message
デバグ debug
外部コマンドの呼び出し
外部コマンド実行(0,1戻り)
文字列をリストに string to list
継続行
論理演算子
文字列 Strings
comparison 比較
print
split spaces 空白区切り取り出し
コマンドライン引数の取得
シングル・ダブルクオテーション
数値<->文字列
文字列から単語のリスト
文字列の切り出し
文字列の特定文字での分割
文字列検索
文字列置換
書式付文字列 formatted string
辞書 dictionary
キーを指定して値を得る
辞書のソート
辞書の作成
関数 functions
check identify 実体が同じか
mainの使い方(how to use main)
デフォルト引数 default argument
変数のスコープ scope of variable
定義と使用を同じファイルで,def & use in same file
関数の名前の変更
関数の戻り値をリストにする
!common mistakes
basemap: lat lon 2d
default axis
integer division
slice to n+1
substitute misunderstanding
y-z direction
ディレクトリが無い(directory does not exist)
!外部リンク ext. link
data science handbook
DelSole class note
python OpenDAP
コーディングルール coding rule PEP8
Python Tips & Memos by Physical Oceanography & Climate Laboratory in Hokkaido University
数値<->文字列
#数値を文字列にするには
文字列=str(数値)
#文字列を数値にするには
数値=int(文字列)
Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse