{"categories":["python","\u7d71\u8a08\u30fb\u5206\u5e03","\u8ad6\u6587","numpy"],"version":"1.0","type":"rich","author_url":"https://blog.hatena.ne.jp/coffee_kabu/","published":"2025-12-19 00:00:00","blog_url":"https://coffee-guhaw.hateblo.jp/","height":"190","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2025%2F12%2F19%2F000000\" title=\"\u3010numpy, python3\u3011\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0(histogram)\u3067\u6700\u983b\u5024(mode)\u3092\u53d6\u308a\u51fa\u3057\u305f\u3044 - Bus error\u3068Segmentation fault\u306b\u56f0\u3063\u305f\u3089\u898b\u308b\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://coffee-guhaw.hateblo.jp/entry/2025/12/19/000000","blog_title":"Bus error\u3068Segmentation fault\u306b\u56f0\u3063\u305f\u3089\u898b\u308b\u30d6\u30ed\u30b0","author_name":"coffee_kabu","image_url":null,"title":"\u3010numpy, python3\u3011\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0(histogram)\u3067\u6700\u983b\u5024(mode)\u3092\u53d6\u308a\u51fa\u3057\u305f\u3044","description":"hist, bins = np.histogram(input_data, nbin) delta = (bins[1]-bins[0])/2 xr = np.linspace(np.min(bins)+delta,np.max(bins)-delta,len(bins)-1) x_max = xr[np.argmax(hist)]input_data \u3068\u3044\u3046\u306e\u304c\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u30c7\u30fc\u30bf x_max\u304c\u6700\u983b\u5024 \u305f\u3060\u3057\u3001\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306a\u306e\u3067\u3001\u968e\u6bb5\u72b6\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u3053\u3053\u306ex_max\u306f\u305d\u306e\u968e\u6bb5\u306e\u771f\u3093\u4e2d\u306e\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3046\u25a0 \u53c2\u8003 : numpy\u3067\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306e\u6700\u5927\u5730\u70b9\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570 \u30e9\u30f3\u30ad\u30f3\u30b0\u53c2\u52a0\u4e2d\u3067\u3059\u2026"}