1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Scipyでビニング処理

Posted at

Scipyを使って簡単なビニング処理

データf(x)が得られたとする。生データの点xが均等でなくて、かつ補間とかはしたくないなあ、という場合にはxをいい感じに区切ってビニングしたい。

「python ビニング」ってググるとpandasを使ったものしか出てこない。しかし私はpandas好きじゃないのでscipyを使う方法をメモ。

import numpy as np
from scipy.stats import binned_statistics

scipy.stats.binned_statisticsというのを使う。

参考文献

公式リファレンス
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.binned_statistic.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?