Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
scipy.ndimage solution in 3rd party category for Radiation Search by rodka81
from scipy.ndimage import label
import numpy as np
def checkio(matrix):
m = np.array(matrix)
max_cov = max_feature = 0
for n in range(1, 6):
labeled, num_features = label(m == n)
for val, cnt in dict(zip(*np.unique(labeled, return_counts=True))).items():
if val > 0 and cnt > max_cov:
max_cov = np.asscalar(cnt)
max_feature = n
return [max_cov, max_feature]
Feb. 18, 2019
Comments: