This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Your code here! | |
import numpy as np | |
data=np.array([[4.87,4.93,4.86,4.85],[4.86,4.90,4.85,4.86],[4.90,4.89,4.85,4.84],[4.87,4.91,4.81,4.86],[4.85,4.92,4.83,4.89]]) | |
# data = np.array([[33,31,33],[30,29,31],[33,28,32],[29,29,32],[32,27,36]]) | |
data_flatten = data.flatten() | |
data_mean = data_flatten.mean() | |
print("全体平均:{}".format(data_mean)) | |
#列の平均 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
#配列をn分割 | |
def split_data(data,split_num): | |
split_arr=[] | |
for i in range(0,len(data),split_num): | |
split_tmp_arr = data[i:i+split_num] | |
split_tmp_arr = np.array(split_tmp_arr).flatten() | |
split_arr.append(split_tmp_arr.tolist()) | |
return split_arr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import glob | |
import os | |
import matplotlib.pyplot as plt | |
import numpy as np | |
SIZE = 416 | |
path ="画像フォルダのパス" | |
save_path = "保存先のパス" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
必要なモジュール | |
""" | |
import glob | |
import cv2 | |
import numpy as np | |
import glob | |
import os | |
from scipy.ndimage.interpolation import rotate | |
from scipy.misc import imresize |
OlderNewer