小林 未知数の備忘録
Julia

Juliaメモ

頻繁に混同するjuliaとpython (numpy)とfortran

python,numpy julia fortran
配列の形状 np.shape size
配列の全要素数 np.size length
配列の次元 np.ndim ndims
配列の型の確認 .dtype typeof
sumやmeanにおける軸の指定 axis= dims= dim=
配列の最大、最小 np.max, np.min maximum, minimum maxval, minval
最大、最小の場所 np.argmax, np.argmin argmax, argmin maxloc, minloc
ゼロ要素の配列 np.zeros zeros
(最初、最後、間隔) を指定した配列 np.arange range(step=)
(最初、最後、要素数) を指定した配列 np.linspace range(length=)
整数の割り算 A//B A÷B A/B
文字の結合 A+B A*B A//B
配列の巡回シフト np.roll circshift cshift
数値→文字 str string write
ループ強制終了 break break exit
ループの始めに戻る continue continue cycle
剰余 % % mod
論理和、論理積 or, and ||, && or, and
\((-\pi,\pi]\)を返す逆正接 np.arctan2(y,x) atan(y,x) atan2(y,x)