0

Python初心者として、少し助けが必要です。100 行 100 列の配列があります。各位置は温度値を表します。私は今、配列全体の平均を計算したいと思います(私はこれまでにそれを持っています)。次に、最初の配列と同じ次元で、各位置の標準偏差を持つ新しい配列を作成します。最後に、各位置での平均からの偏差を含む配列を取得したいので、各値が平均からどれだけ広がっているかを知りたいです。私の言いたいことを理解していただければ幸いです。理解を深めるために、アレイは家屋の赤外線サーモグラフィ画像です。標準偏差の計算により、画像内の最高の反応性/敏感なピクセルを取得したいと考えています。誰かが以前にこのようなことをしたことがあるかもしれません。最後に、ファイルをエクスポートして、赤外線画像に似た画像を取得したいと考えています。

ファイルをインポートして、次のように平均を計算します。

data_mean = []

my_array = np.genfromtxt((line.replace(',','.') for line in data),skip_header=9,delimiter=";")

data_mean.append(np.nanmean(my_array))

次に、配列内の各位置の標準偏差を計算する必要があります。

助けてくれてありがとう!

4

2 に答える 2

0

If you are keeping the data in an array format here is a solution:

import numpy as np

#Find the mean of the array data values
mean_value = np.mean(data_mean)

#Find the standard deviation of the array data values
standard_deviation = np.std(data_mean)

#create an array consisting of the standard deviations from the mean
array = data_mean/standard_deviation
于 2015-08-25T15:52:52.880 に答える
0
data_mean = np.mean(my_array) #gets you the mean of the whole array

すべての値がデータの平均である配列を返します

meanArray = np.ones(my_array.shape)*data_mean 

variationFromMean = my_array - meanArray

これはあなたが探していたものですか?

于 2015-08-25T13:31:06.760 に答える