LoginSignup
1
0

More than 3 years have passed since last update.

numpyのライブラリ関数一覧を少しずつ入れていく - c編

Posted at

numpyの関数リストのc編を作りました。ググって簡単にどういうことしてるか書いて、使えそうな例のあるリンク先を貼ってるだけですが、これをやってるとだんだんnumpyでどういうことができるかわかってきます。そろそろコードの入った記事も試してみたいところです。

 np.c_ 接続、中で後ろにつなげる r_はより内側につなぐ hstackと同じ
 np.can_cast (a,b) でaからbにキャストできるならTrue。キャストとは別の型に変換すること
  https://numpy.org/doc/stable/reference/generated/numpy.can_cast.html
 np.cast 型変換する。今はastypeに取って代わられてる?
  https://www.programcreek.com/python/example/61566/numpy.cast
 np.cbrt 立方根
 np.cdouble doubleのサイズをもった複素数の型
 np.ceil 切り上げ
 np.cfloat floatのサイズをもった複素数の型
 np.char char型だがこれにつながる関数が多数
  https://numpy.org/doc/stable/reference/routines.char.html
 np.character ?
 np.chararray 文字列演算のベクトル化
  http://www.turbare.net/transl/scipy-lecture-notes/advanced/advanced_numpy/index.html
 np.choose 2次元arrayの中から1次元arrayの値に従った番号の値を抽出
  https://qiita.com/junkoda/items/2d1d82e00b29e50df90c
 np.clip array内の値に上限値と下限値を与えて制限する
  https://analytics-note.xyz/programming/numpy-clip/
 np.clongdouble 複素数で片方が整数、片方が浮動小数点? (あとで下記をみて確認)
  https://www.programcreek.com/python/example/78125/numpy.clongdouble
 np.clongfloat clongdoubleに類似。浮動小数側が単精度に
 np.column_stack 2つのベクトルを縦か横に結合して2次元配列を作る
  https://stats.biopapyrus.jp/python/vector.html
 np.common_type arrayの型を返す
  https://numpy.org/doc/stable/reference/generated/numpy.common_type.html
 np.compare_chararrays 2つの文字列配列の要素別比較
  https://kite.com/python/docs/numpy.compare_chararrays
 np.compat ?
 np.complex 複素数の型
 np.complex128 計128ビットの複素数
 np.complex256 計256ビットの複素数
 np.complex64 計64ビットの複素数
 np.complex_ np.complex128と同じ
 np.complexfloating ?
 np.compress 条件にあうものを選択してそれの配列にする
  https://numpy.org/doc/1.18/reference/generated/numpy.compress.html
  https://www.youtube.com/watch?v=B0gN6Jn4QSg
 np.concatenate arrayを結合する
  https://note.nkmk.me/python-numpy-concatenate-stack-block/
 np.conj 複素共役(虚数の符号を反転させたもの)を返す。もととかければ実数にできる
  https://deepage.net/features/numpy-math.html
 np.conjugate 複素共役を返す。np.conjと同じ
 np.convolve 畳み込み計算を行う。CNNの畳み込み部分を1次元でやる関数
  https://deepage.net/features/numpy-convolve.html
 np.copy コピーする
  https://qiita.com/mytk0u0/items/231807f4136b2b1681b0
 np.copysign 別の配列から符号部分だけをコピーする
  https://note.nkmk.me/python-numpy-sign-signbit-copysign/
 np.copyto 配列をコピーする
  https://www.programcreek.com/python/example/102241/numpy.copyto
 np.core ?
 np.corrcoef 相関係数を計算する
  https://deepage.net/features/numpy-corrcoef.html
 np.correlate 相互相関関数を計算する - 下記を見てあとで理解しておく
  https://lambdalisue.hatenablog.com/entry/2017/01/04/194634
 np.cos コサイン
 np.cosh ハイパボリックコサイン
 np.count_nonzero 条件を入れてTrueの数をカウントする
  https://note.nkmk.me/python-numpy-count/
 np.cov 共分散を計算する
  https://deepage.net/features/numpy-cov.html
 np.cross ベクトルの外積を計算する
  https://algorithm.joho.info/programming/python-numpy-vector-cross/
 np.csingle singleのサイズをもった複素数の型
 np.ctypeslib C言語との連携で使う。C言語の関数の呼び出し。ここは勉強しておく
  https://kyotogeopython.zawawahoge.com/html/%E5%BF%9C%E7%94%A8%E7%B7%A8/Fortran,%20C%E8%A8%80%E8%AA%9E%20%E3%81%A8%E3%81%AE%E9%80%A3%E6%90%BA.html
 np.cumprod 累積積(配列内を順に掛け算していく)を計算する
  http://pppurple.hatenablog.com/entry/2016/05/02/235158
 np.cumproduct np.cumprodと同じ?
 np.cumsum 要素を足し合わせたものを配列として入れる
  https://qiita.com/Sa_qiita/items/fc61f776cef657242e69

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0