{"id":553398,"date":"2025-03-18T06:28:36","date_gmt":"2025-03-18T05:28:36","guid":{"rendered":"https:\/\/blog.jetbrains.com\/pycharm\/2025\/01\/data-cleaning-in-data-science\/"},"modified":"2025-09-15T16:40:12","modified_gmt":"2025-09-15T15:40:12","slug":"data-cleaning-in-data-science","status":"publish","type":"pycharm","link":"https:\/\/blog.jetbrains.com\/ja\/pycharm\/2025\/03\/data-cleaning-in-data-science\/","title":{"rendered":"\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3068\u306f\uff1f\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3067\u91cd\u8981\u306a\u624b\u9806\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9"},"content":{"rendered":"<p>\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u306b\u95a2\u3059\u308b\u3053\u306e\u30d6\u30ed\u30b0\u9023\u8f09\u8a18\u4e8b\u3067\u306f\u3001<a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/how-to-get-data\/\">\u30c7\u30fc\u30bf\u306e\u5165\u624b\u5834\u6240<\/a>\u3068 <a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/data-exploration-with-pandas\/\" target=\"_blank\" rel=\"noreferrer noopener\">pandas \u3092\u4f7f\u7528\u3057\u3066\u305d\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3092\u63a2\u7d22<\/a>\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u305d\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u306f\u5b66\u7fd2\u7528\u9014\u306b\u6700\u9069\u3067\u3059\u304c\u3001<em>\u73fe\u5b9f\u4e16\u754c<\/em>\u306e\u30c7\u30fc\u30bf\u3068\u306f\u307e\u3063\u305f\u304f\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u5b66\u7fd2\u7528\u306e\u30c7\u30fc\u30bf\u306f\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3068\u30ad\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u5b8c\u4e86\u3057\u305f\u72b6\u614b\u3067\u63d0\u4f9b\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u305f\u3081\u3001\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306e\u4e16\u754c\u3092\u7d4c\u9a13\u3057\u306a\u304f\u3066\u3082\u3059\u3050\u306b\u5b66\u7fd2\u306b\u53d6\u308a\u639b\u304b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4e00\u65b9\u3001\u73fe\u5b9f\u4e16\u754c\u306e\u30c7\u30fc\u30bf\u306f\u554f\u984c\u304c\u3042\u308a\u3001\u6574\u7406\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u3067\u3059\u3002 \u73fe\u5b9f\u4e16\u754c\u306e\u30c7\u30fc\u30bf\u306e\u5834\u5408\u3001\u6709\u7528\u306a\u30a4\u30f3\u30b5\u30a4\u30c8\u3092\u5f97\u308b\u305f\u3081\u306b\u306f\u4e8b\u524d\u306b\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u304c\u4eca\u56de\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u306e\u30c8\u30d4\u30c3\u30af\u3067\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u554f\u984c\u306f\u3001\u30c7\u30fc\u30bf\u81ea\u4f53\u306e\u6319\u52d5\u3001\u30c7\u30fc\u30bf\u306e\u53ce\u96c6\u65b9\u6cd5\u3001\u3055\u3089\u306b\u306f\u30c7\u30fc\u30bf\u306e\u5165\u529b\u65b9\u6cd5\u306b\u3088\u3063\u3066\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u30df\u30b9\u3084\u898b\u904e\u3054\u3057\u306f\u3001\u3053\u308c\u3089\u306e\u3069\u306e\u6bb5\u968e\u306b\u304a\u3044\u3066\u3082\u767a\u751f\u3057\u3046\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u30c7\u30fc\u30bf\u5909\u63db\u3067\u306f\u306a\u304f\u3001\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306b\u9650\u5b9a\u3057\u3066\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3067\u306f\u3001\u30c7\u30fc\u30bf\u304b\u3089\u5c0e\u304d\u51fa\u3057\u305f\u7d50\u8ad6\u3092\u5b9a\u7fa9\u3057\u305f\u6bcd\u96c6\u56e3\u306b\u4e00\u822c\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u5bfe\u7167\u7684\u306b\u3001\u30c7\u30fc\u30bf\u5909\u63db\u3067\u306f\u30c7\u30fc\u30bf\u5f62\u5f0f\u306e\u5909\u63db\u3001\u30c7\u30fc\u30bf\u306e\u6b63\u898f\u5316\u3001\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u306a\u3069\u306e\u30bf\u30b9\u30af\u304c\u4f34\u3044\u307e\u3059\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u306a\u305c\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u304c\u91cd\u8981\u306a\u306e\u304b\uff1f\u30c7\u30fc\u30bf\u5206\u6790\u306e\u7cbe\u5ea6\u3092\u5411\u4e0a\u3055\u305b\u308b\u7406\u7531<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u3064\u3044\u3066\u6700\u521d\u306b\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u306f\u3001\u305d\u308c\u304c\u4f55\u3092\u4ee3\u8868\u3057\u3066\u3044\u308b\u304b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002 \u307b\u3068\u3093\u3069\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u3088\u308a\u5e45\u5e83\u3044\u6bcd\u96c6\u56e3\u3092\u4ee3\u8868\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u3067\u3042\u308a\u3001\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u51e6\u7406\u3057\u3066\u5f97\u3089\u308c\u305f\u7d50\u679c\u3092\u305d\u306e\u6bcd\u96c6\u56e3\u306b\u5916\u633f\u3059\u308b\uff08\u307e\u305f\u306f<em>\u4e00\u822c\u5316<\/em>\uff09\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u305f\u3068\u3048\u3070\u3001\u524d\u306e 2 \u3064\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u306f\u3001\u3042\u308b<a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002 \u305d\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u5927\u307e\u304b\u306b\u306f\u4f4f\u5b85\u8ca9\u58f2\u306b\u95a2\u3059\u308b\u3082\u306e\u3067\u3059\u304c\u3001\u5c0f\u3055\u306a\u5730\u7406\u7684\u306a\u30a8\u30ea\u30a2\u3068\u77ed\u3044\u671f\u9593\u306e\u307f\u3092\u7db2\u7f85\u3057\u3066\u3044\u308b\u3082\u306e\u3067\u3001\u305d\u306e\u30a8\u30ea\u30a2\u3068\u671f\u9593\u5185\u306e\u3059\u3079\u3066\u306e\u4f4f\u5b85\u3092\u7db2\u7f85\u3057\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u304c\u3001\u3088\u308a\u5927\u304d\u306a\u6bcd\u96c6\u56e3\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306f\u3088\u308a\u5e45\u5e83\u3044\u6bcd\u96c6\u56e3\u3092\u4ee3\u8868\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u5b9a\u7fa9\u3057\u305f\u671f\u9593\u306b\u304a\u3051\u308b\u5bfe\u8c61\u30a8\u30ea\u30a2\u306e\u3059\u3079\u3066\u306e\u4f4f\u5b85\u8ca9\u58f2\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002 \u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u3092\u78ba\u5b9f\u306b\u3088\u308a\u5e45\u5e83\u3044\u6bcd\u96c6\u56e3\u3092\u4ee3\u8868\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306b\u3059\u308b\u306b\u306f\u3001\u6700\u521d\u306b\u6bcd\u96c6\u56e3\u306e\u5883\u754c\u3092\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3054\u60f3\u50cf\u306e\u901a\u308a\u3001\u304a\u305d\u3089\u304f\u56fd\u52e2\u8abf\u67fb\u30c7\u30fc\u30bf\u3092\u9664\u3051\u3070\u3001\u6bcd\u96c6\u56e3\u5168\u4f53\u3092\u4f7f\u3063\u3066\u4f5c\u696d\u3059\u308b\u306e\u306f\u5f80\u3005\u306b\u3057\u3066\u73fe\u5b9f\u7684\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u5883\u754c\u3092\u3069\u3053\u306b\u7f6e\u304f\u306e\u304b\u3092\u6c7a\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u3088\u3046\u306a\u5883\u754c\u306f\u3001\u5730\u7406\u3001\u4eba\u53e3\u7d71\u8a08\u3001\u671f\u9593\u3001\u884c\u52d5\u3084\u6d3b\u52d5\uff08\u53d6\u5f15\u306a\u3069\uff09\u3001\u307e\u305f\u306f\u696d\u754c\u56fa\u6709\u306e\u3082\u306e\u306a\u3069\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u6bcd\u96c6\u56e3\u306e\u5b9a\u7fa9\u306b\u306f\u591a\u6570\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30c7\u30fc\u30bf\u3092\u78ba\u5b9f\u306b\u4e00\u822c\u5316\u3059\u308b\u306b\u306f\u3001\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3059\u308b\u524d\u306b\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u8981\u3059\u308b\u306b\u3001\u5206\u6790\u3084<a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2022\/06\/start-studying-machine-learning-with-pycharm\/\">\u6a5f\u68b0\u5b66\u7fd2<\/a>\u306a\u3069\u306e\u76ee\u7684\u3067\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u6642\u9593\u3092\u304b\u3051\u3066\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3057\u3001\u30a4\u30f3\u30b5\u30a4\u30c8\u3092\u4fe1\u983c\u3057\u3066<em>\u73fe\u5b9f\u4e16\u754c<\/em>\u306b\u4e00\u822c\u5316\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3059\u308b\u3068\u5206\u6790\u306e\u6b63\u78ba\u6027\u304c\u5897\u3057\u3001\u6a5f\u68b0\u5b66\u7fd2\u306b\u304a\u3044\u3066\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3082\u6539\u5584\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3057\u306a\u3051\u308c\u3070\u5b66\u7fd2\u7d50\u679c\u3092\u5e45\u5e83\u3044\u6bcd\u96c6\u56e3\u306b\u78ba\u5b9f\u306b\u4e00\u822c\u5316\u3067\u304d\u305a\u3001\u8981\u7d04\u7d71\u8a08\u304c\u4e0d\u6b63\u78ba\u306b\u306a\u308a\u3001\u4e0d\u6b63\u306b\u53ef\u8996\u5316\u3055\u308c\u308b\u306a\u3069\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u3092\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u305d\u308c\u304c\u30a8\u30e9\u30fc\u3084\u4e0d\u6b63\u78ba\u306a\u4e88\u6e2c\u306e\u539f\u56e0\u306b\u306a\u308b\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p align=\"center\"><a class=\"jb-download-button\" href=\"https:\/\/jb.gg\/m8p92h\" target=\"_blank\" rel=\"noopener\"><br \/>PyCharm Professional \u3092\u7121\u6599\u3067\u8a66\u3059<br \/><\/a><\/p>\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306e\u5177\u4f53\u4f8b \u2013 5 \u3064\u306e\u4e3b\u8981\u624b\u9806<\/h2>\n<p>\u30c7\u30fc\u30bf\u306e\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306b\u4f7f\u7528\u3067\u304d\u308b 5 \u3064\u306e\u30bf\u30b9\u30af\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u3053\u306e\u30ea\u30b9\u30c8\u306f\u7db2\u7f85\u7684\u306a\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u521d\u3081\u3066\u73fe\u5b9f\u4e16\u754c\u306e\u30c7\u30fc\u30bf\u306b\u53d6\u308a\u639b\u304b\u308b\u969b\u306b\u306f\u5f79\u306b\u7acb\u3064\u306f\u305a\u3067\u3059\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u306e\u91cd\u8907\u6392\u9664<\/h3>\n<p>\u91cd\u8907\u306f\u30c7\u30fc\u30bf\u3092\u6b6a\u3081\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u554f\u984c\u3067\u3059\u3002 \u8ca9\u58f2\u4fa1\u683c\u306e\u51fa\u73fe\u983b\u5ea6\u3092\u4f7f\u7528\u3057\u3066\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3068\u60f3\u50cf\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u540c\u3058\u5024\u304c\u91cd\u8907\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u91cd\u8907\u3057\u305f\u4fa1\u683c\u306b\u57fa\u3065\u3044\u3066\u4e0d\u6b63\u78ba\u306a\u30d1\u30bf\u30fc\u30f3\u306e\u3042\u308b\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u304c\u4f5c\u6210\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u88dc\u8db3\u3057\u3066\u304a\u304d\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u91cd\u8907\u304c\u554f\u984c\u3067\u3042\u308b\u3068\u8a00\u3046\u5834\u5408\u306f\u3001\u5404\u884c\u304c\u5358\u4e00\u306e\u89b3\u6e2c\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u884c\u305d\u306e\u3082\u306e\u304c\u91cd\u8907\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u6307\u3057\u3066\u3044\u307e\u3059\u3002 \u5217\u306b\u306f\u91cd\u8907\u3057\u305f\u5024\u304c\u3042\u3063\u3066\u3082\u3001\u305d\u308c\u306f\u4e88\u60f3\u3055\u308c\u308b\u3053\u3068\u3067\u3059\u3002 \u3053\u3053\u3067\u306f\u3001\u91cd\u8907\u3057\u305f\u89b3\u6e2c\u5024\u306b\u3064\u3044\u3066\u306e\u307f\u53d6\u308a\u4e0a\u3052\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5e78\u3044\u306b\u3082\u3001\u30c7\u30fc\u30bf\u5185\u306e\u91cd\u8907\u3092\u691c\u51fa\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064 <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.duplicated.html\" target=\"_blank\" rel=\"noopener\">pandas \u30e1\u30bd\u30c3\u30c9<\/a>\u304c\u3042\u308a\u307e\u3059\u3002 \u5fc5\u8981\u3067\u3042\u308c\u3070\u3001<a href=\"https:\/\/www.jetbrains.com\/ja-jp\/ai\/\" target=\"_blank\" rel=\"noopener\">JetBrains AI<\/a> \u30c1\u30e3\u30c3\u30c8\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>C<em>ode to identify duplicate rows<\/em><\/p>\n<p>\u4ee5\u4e0b\u306e\u7d50\u679c\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">duplicate_rows = df[df.duplicated()]\nduplicate_rows<\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f DataFrame \u304c <code>\"df\"<\/code> \u3068\u3044\u3046\u540d\u524d\u3067\u3042\u308b\u60f3\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b DataFrame \u306e\u540d\u524d\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u308c\u307e\u3067\u4f7f\u7528\u3057\u3066\u304d\u305f <a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">Ames Housing \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u306b\u306f\u91cd\u8907\u30c7\u30fc\u30bf\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4e0a\u8a18\u306e pandas \u30e1\u30bd\u30c3\u30c9\u3092\u8a66\u3057\u3066\u307f\u305f\u3044\u65b9\u306f <a href=\"https:\/\/www.kaggle.com\/datasets\/cites\/cites-wildlife-trade-database\" target=\"_blank\" rel=\"noopener\">CITES Wildlife Trade Database<\/a> \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u4f7f\u7528\u3057\u3001\u91cd\u8907\u306e\u6709\u7121\u3092\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306b\u91cd\u8907\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u3001\u305d\u308c\u3092\u9664\u53bb\u3057\u3066\u7d50\u679c\u306b\u6b6a\u307f\u304c\u751f\u3058\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3082 JetBrains AI \u3067\u6b21\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<p><em>Code to drop duplicates from my dataframe\u00a0<\/em><\/p>\n<p>\u51fa\u529b\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3067\u306f\u91cd\u8907\u304c\u6392\u9664\u3055\u308c\u3001DataFrame \u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u3001\u305d\u306e\u5f8c\u306b df_cleaned \u3068\u3044\u3046\u540d\u524d\u306e\u65b0\u3057\u3044 DataFrame \u3068\u3057\u3066\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df_cleaned = df.drop_duplicates()\ndf_cleaned.reset_index(drop=True, inplace=True)\ndf_cleaned<\/pre>\n<p>\u3088\u308a<a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.drop_duplicates.html\" target=\"_blank\" rel=\"noopener\">\u9ad8\u5ea6\u306a\u91cd\u8907\u7ba1\u7406<\/a>\u306b\u4f7f\u7528\u3067\u304d\u308b pandas \u95a2\u6570\u306f\u4ed6\u306b\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u91cd\u8907\u6392\u9664\u304c\u521d\u3081\u3066\u306e\u65b9\u306b\u306f\u3053\u308c\u3067\u5341\u5206\u3067\u3059\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u3042\u308a\u5f97\u306a\u3044\u5024\u306e\u51e6\u7406<\/h3>\n<p>\u30c7\u30fc\u30bf\u304c\u8aa4\u3063\u3066\u5165\u529b\u3055\u308c\u305f\u5834\u5408\u3084\u30c7\u30fc\u30bf\u53ce\u96c6\u30d7\u30ed\u30bb\u30b9\u3067\u4f55\u3089\u304b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u3042\u308a\u5f97\u306a\u3044\u5024\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 <a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">Ames Housing \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u306e\u5834\u5408\u306f\u3001\u30de\u30a4\u30ca\u30b9\u306e SalePrice \u3084 Roof Style \u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u6570\u5024\u304c\u3042\u308a\u5f97\u306a\u3044\u5024\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u3042\u308a\u5f97\u306a\u3044\u5024\u3092\u7279\u5b9a\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/data-exploration-with-pandas\/#summary-statistics\">\u8981\u7d04\u7d71\u8a08<\/a>\u3092\u78ba\u8a8d\u3059\u308b\u3001\u5217\u3054\u3068\u306b\u53ce\u96c6\u8005\u306b\u3088\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u691c\u8a3c\u30eb\u30fc\u30eb\u3092\u78ba\u8a8d\u3059\u308b\u3001\u305d\u306e\u691c\u8a3c\u304b\u3089\u5916\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3092\u8a18\u9332\u3059\u308b\u3001\u53ef\u8996\u5316\u306b\u3088\u3063\u3066\u7570\u5e38\u3060\u3068\u601d\u308f\u308c\u308b\u30d1\u30bf\u30fc\u30f3\u3084\u305d\u306e\u4ed6\u306e\u7279\u5fb4\u3092\u7279\u5b9a\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u591a\u69d8\u306a\u624b\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3042\u308a\u5f97\u306a\u3044\u5024\u306f\u30ce\u30a4\u30ba\u306e\u6df7\u5165\u3084\u5206\u6790\u6642\u306e\u554f\u984c\u306e\u539f\u56e0\u3068\u306a\u308a\u5f97\u308b\u305f\u3081\u3001\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u305f\u3060\u3057\u3001\u51e6\u7406\u65b9\u6cd5\u306b\u306f\u3055\u307e\u3056\u307e\u306a\u89e3\u91c8\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u30b5\u30a4\u30ba\u306b\u6bd4\u3079\u3066\u3042\u308a\u5f97\u306a\u3044\u5024\u306e\u6570\u304c\u591a\u304f\u306a\u3051\u308c\u3070\u3001\u305d\u306e\u3088\u3046\u306a\u5024\u3092\u542b\u3080\u30ec\u30b3\u30fc\u30c9\u3092\u9664\u53bb\u3059\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002 \u305f\u3068\u3048\u3070\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e 214 \u884c\u76ee\u306b\u3042\u308a\u5f97\u306a\u3044\u5024\u3092\u898b\u3064\u3051\u305f\u5834\u5408\u3001<a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.drop.html\" target=\"_blank\" rel=\"noopener\">pandas drop \u95a2\u6570<\/a>\u3067\u305d\u306e\u884c\u3092\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304b\u3089\u9664\u53bb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3082 JetBrains AI \u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3001\u5fc5\u8981\u306a\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><em>Code that drops index 214 from <\/em><em>#df_cleaned<\/em><\/p>\n<p><a href=\"https:\/\/pleiades.io\/help\/pycharm\/jupyter-notebook-support.html\" target=\"_blank\" rel=\"noopener\">PyCharm \u306e Jupyter \u30ce\u30fc\u30c8\u30d6\u30c3\u30af<\/a>\u3067\u306f\u3001\u5358\u8a9e\u306e\u524d\u306b # \u8a18\u53f7\u3092\u4ed8\u3051\u308b\u3053\u3068\u3067\u3001JetBrains AI Assistant \u306b\u8ffd\u52a0\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u793a\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001DataFrame \u304c <code>\"df_cleaned\"<\/code> \u3068\u3044\u3046\u540d\u524d\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3067\u306f\u5bfe\u8c61\u306e\u89b3\u6e2c\u5024\u304c DataFrame \u304b\u3089\u9664\u53bb\u3055\u308c\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u3066\u304b\u3089\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df_cleaned = df_cleaned.drop(index=214)\ndf_cleaned.reset_index(drop=True, inplace=True)\ndf_cleaned<\/pre>\n<p>\u3042\u308a\u5f97\u306a\u3044\u5024\u3092\u51e6\u7406\u3059\u308b\u6226\u7565\u3068\u3057\u3066\u306f\u3001\u4ee3\u5165\u3092\u4f7f\u7528\u3059\u308b\u306e\u3082\u4e00\u822c\u7684\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u3042\u308a\u5f97\u306a\u3044\u5024\u3092\u5b9a\u7fa9\u3055\u308c\u305f\u6226\u7565\u306b\u57fa\u3065\u3044\u3066\u5225\u306e\u3042\u308a\u5f97\u308b\u5024\u306b\u7f6e\u304d\u63db\u3048\u308b\u306e\u3067\u3059\u3002 \u6700\u3082\u4e00\u822c\u7684\u306a\u6226\u7565\u306e 1 \u3064\u306f\u3001\u3042\u308a\u5f97\u306a\u3044\u5024\u306e\u4ee3\u308f\u308a\u306b\u4e2d\u592e\u5024\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002 \u4e2d\u592e\u5024\u306f\u5916\u308c\u5024\u306e\u5f71\u97ff\u3092\u53d7\u3051\u306a\u3044\u305f\u3081\u3001\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30c6\u30a3\u30b9\u30c8\u306b\u3053\u306e\u76ee\u7684\u3067\u3088\u304f\u9078\u3070\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u308c\u3068\u540c\u69d8\u306b\u30c7\u30fc\u30bf\u306e\u5e73\u5747\u5024\u3084\u30e2\u30fc\u30c9\u5024\u306e\u65b9\u304c\u9069\u3057\u3066\u3044\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3068\u305d\u306e\u30c7\u30fc\u30bf\u306e\u53ce\u96c6\u65b9\u6cd5\u306b\u95a2\u3059\u308b\u5c02\u9580\u77e5\u8b58\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u3042\u308a\u5f97\u306a\u3044\u5024\u3092\u3088\u308a\u610f\u5473\u306e\u3042\u308b\u5024\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u53ce\u96c6\u30d7\u30ed\u30bb\u30b9\u306b\u95a2\u308f\u3063\u3066\u3044\u308b\u5834\u5408\u3084\u305d\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u7406\u89e3\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u3053\u3061\u3089\u306e\u65b9\u6cd5\u304c\u9069\u3057\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3069\u306e\u65b9\u6cd5\u3092\u9078\u629e\u3057\u3066\u3042\u308a\u5f97\u306a\u3044\u5024\u3092\u51e6\u7406\u3059\u308b\u304b\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u3067\u306e\u305d\u306e\u5024\u306e\u51fa\u73fe\u983b\u5ea6\u3001\u30c7\u30fc\u30bf\u306e\u53ce\u96c6\u65b9\u6cd5\u3001\u6bcd\u96c6\u56e3\u306e\u5b9a\u7fa9\u65b9\u6cd5\u3001\u304a\u3088\u3073\u5c02\u9580\u77e5\u8b58\u306a\u3069\u306e\u4ed6\u306e\u8981\u56e0\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u306e\u66f8\u5f0f<\/h3>\n<p>\u591a\u304f\u306e\u5834\u5408\u3001<a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/data-exploration-with-pandas\/#summary-statistics\">\u8981\u7d04\u7d71\u8a08<\/a>\u3084\u65e9\u3044\u6bb5\u968e\u3067<a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/data-exploration-with-pandas\/#graphs\">\u53ef\u8996\u5316<\/a>\u3092\u884c\u3063\u3066\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u306b\u95a2\u3059\u308b\u6982\u8981\u3092\u628a\u63e1\u3059\u308b\u3053\u3068\u3067\u3001\u66f8\u5f0f\u306e\u554f\u984c\u3092\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002 \u66f8\u5f0f\u304c\u77db\u76fe\u3057\u3066\u3044\u308b\u4f8b\u306b\u306f\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306e\u6841\u6570\u306e\u5b9a\u7fa9\u304c\u7d71\u4e00\u3055\u308c\u3066\u3044\u306a\u3044\u6570\u5024\u3084\u3001&#8221;first&#8221; \u3084 &#8220;1st&#8221; \u306e\u3088\u3046\u306a\u30b9\u30da\u30eb\u306e\u3070\u3089\u3064\u304d\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u306e\u66f8\u5f0f\u304c\u8aa4\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u30c7\u30fc\u30bf\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u3082\u554f\u984c\u304c\u751f\u3058\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u3067\u66f8\u5f0f\u306e\u554f\u984c\u304c\u898b\u3064\u304b\u3063\u305f\u5834\u5408\u306f\u3001\u5024\u3092\u6a19\u6e96\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u767a\u751f\u3057\u3066\u3044\u308b\u554f\u984c\u306b\u3088\u308a\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u72ec\u81ea\u306e\u6a19\u6e96\u3092\u5b9a\u7fa9\u3057\u3066\u5909\u66f4\u3092\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u306b\u3064\u3044\u3066\u3082\u3001pandas \u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.round.html\" target=\"_blank\" rel=\"noopener\">round<\/a> \u306e\u3088\u3046\u306a\u4fbf\u5229\u306a\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002 SalesPrice \u5217\u3092\u5c0f\u6570\u70b9\u4ee5\u4e0b 2 \u6841\u306b\u4e38\u3081\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066 JetBrains AI \u306b\u305d\u306e\u30b3\u30fc\u30c9\u3092\u554f\u3044\u5408\u308f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><em>Code to round <\/em><em>#SalePrice<\/em><em> to two decimal places\u00a0<\/em><\/p>\n<p>\u751f\u6210\u3055\u308c\u308b\u30b3\u30fc\u30c9\u3067\u306f\u4e38\u3081\u304c\u5b9f\u884c\u3055\u308c\u3001\u305d\u308c\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u306b\u6700\u521d\u306e 10 \u884c\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df_cleaned['SalePrice'] = df_cleaned['SalePrice].round(2)\ndf_cleaned.head()<\/pre>\n<p>\u30b9\u30da\u30eb\u306b\u77db\u76fe\u304c\u3042\u308b\u5834\u5408\u306e\u4f8b\u3082\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u305f\u3068\u3048\u3070\u3001HouseStyle \u5217\u306b &#8220;1Story&#8221; \u3068 &#8220;OneStory&#8221; \u306e\u4e21\u65b9\u304c\u5b58\u5728\u3057\u3066\u304a\u308a\u3001\u3053\u308c\u3089\u304c\u540c\u3058\u3082\u306e\u3092\u610f\u5473\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3053\u306e\u77db\u76fe\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><em>Code to change all instances of <\/em><em>#OneStory<\/em><em> to <\/em><em>#1Story<\/em><em> in <\/em><em>#HouseStyle<\/em><em>\u00a0<\/em><\/p>\n<p>\u751f\u6210\u3055\u308c\u308b\u30b3\u30fc\u30c9\u306f\u307e\u3055\u306b\u3053\u306e\u77db\u76fe\u3092\u89e3\u6d88\u3057\u3001\u3059\u3079\u3066\u306e &#8220;OneStory&#8221; \u3092 &#8220;1Story&#8221; \u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df_cleaned[HouseStyle'] = df_cleaned['HouseStyle'].replace('OneStory', '1Story')<\/pre>\n<h3 class=\"wp-block-heading\">\u5916\u308c\u5024\u306e\u89e3\u6c7a<\/h3>\n<p>\u5916\u308c\u5024\u306f\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306f\u3088\u304f\u767a\u751f\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u5bfe\u51e6\u65b9\u6cd5\u306f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u3088\u3063\u3066\u5927\u304d\u304f\u7570\u306a\u308a\u307e\u3059\u3002 \u5916\u308c\u5024\u3092\u6700\u3082\u7c21\u5358\u306b\u7279\u5b9a\u3059\u308b\u306b\u306f\u7bb1\u3072\u3052\u56f3\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u306b\u306f <a href=\"https:\/\/seaborn.pydata.org\/generated\/seaborn.boxplot.html\" target=\"_blank\" rel=\"noopener\">seaborn<\/a> \u30e9\u30a4\u30d6\u30e9\u30ea\u3068 <a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.pyplot.figure.html\" target=\"_blank\" rel=\"noopener\">matplotlib<\/a> \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u7bb1\u3072\u3052\u56f3\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/data-exploration-with-pandas\/\">pandas \u3067\u30c7\u30fc\u30bf\u3092\u63a2\u7d22\u3059\u308b\u65b9\u6cd5<\/a>\u306b\u95a2\u3059\u308b\u524d\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002\u7c21\u5358\u306a\u304a\u3055\u3089\u3044\u304c\u5fc5\u8981\u3067\u3042\u308c\u3070\u3001\u305d\u3061\u3089\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u306e\u7bb1\u3072\u3052\u56f3\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001<a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">Ames Housing \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u306e SalesPrice \u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u3053\u3053\u3067\u3082 JetBrains AI \u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u3063\u3066\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><em>Code to create a box plot of <\/em><em>#SalePrice<\/em><em>\u00a0<\/em><\/p>\n<p>\u5b9f\u884c\u3059\u3079\u304d\u30b3\u30fc\u30c9\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import seaborn as sns\nimport matplotlib.pyplot as plt\n\n# Create a box plot for SalePrice\nplt.figure(figsize=(10, 6))\nsns.boxplot(x=df_cleaned['SalePrice'])\nplt.title('Box Plot of SalePrice')\nplt.xlabel('SalePrice')\nplt.show()<\/pre>\n<p>\u7bb1\u3072\u3052\u56f3\u304b\u3089\u3001\u9752\u3044\u7bb1\u306e\u5185\u5074\u306b\u3042\u308b\u7e26\u306e\u4e2d\u592e\u5024\u306e\u7dda\u304c\u4e2d\u5fc3\u3088\u308a\u5de6\u5074\u306b\u3042\u308b\u305f\u3081\u3001\u6b63\u306e\u6b6a\u307f\u304c\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u6b63\u306e\u6b6a\u307f\u306f\u3088\u308a\u6bd4\u8f03\u7684\u5b89\u4fa1\u306a\u4f4f\u5b85\u4fa1\u683c\u304c\u591a\u3044\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u9a5a\u304f\u3079\u304d\u3053\u3068\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u7bb1\u3072\u3052\u56f3\u304b\u3089\u306f\u3001\u53f3\u5074\u306b\u5916\u308c\u5024\u304c\u591a\u3044\u3053\u3068\u3082\u8996\u899a\u7684\u306b\u5206\u304b\u308a\u307e\u3059\u3002 \u3053\u308c\u306f\u3001\u4e2d\u592e\u4fa1\u683c\u3088\u308a\u3082\u306f\u308b\u304b\u306b\u9ad8\u4fa1\u306a\u5c11\u6570\u306e\u4f4f\u5b85\u304c\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-536439\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2025\/01\/image.png\" alt=\"\" width=\"1600\" height=\"1054\" \/><\/figure>\n<p>\u5927\u591a\u6570\u306e\u4f4f\u5b85\u3088\u308a\u3082\u9ad8\u4fa1\u306a\u5c0f\u6570\u306e\u4f4f\u5b85\u304c\u3042\u308b\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3053\u3068\u306a\u306e\u3067\u3001\u3053\u306e\u3088\u3046\u306a\u5916\u308c\u5024\u304c\u3042\u308b\u3053\u3068\u306f\u53d7\u3051\u5165\u308c\u3089\u308c\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001 \u3059\u3079\u3066\u306f\u4e00\u822c\u5316\u3059\u308b\u6bcd\u96c6\u56e3\u3068\u30c7\u30fc\u30bf\u304b\u3089\u5c0e\u304d\u51fa\u3059\u7d50\u8ad6\u306b\u3088\u3063\u3066\u6c7a\u307e\u308a\u307e\u3059\u3002 \u6bcd\u96c6\u56e3\u306b\u542b\u307e\u308c\u308b\u3082\u306e\u3068\u542b\u307e\u308c\u306a\u3044\u3082\u306e\u306b\u660e\u78ba\u306a\u5883\u754c\u3092\u5f15\u304f\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u5185\u306e\u5916\u308c\u5024\u304c\u554f\u984c\u3068\u306a\u308b\u304b\u3069\u3046\u304b\u3092\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u5224\u65ad\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u6bcd\u96c6\u56e3\u3092\u69cb\u6210\u3059\u308b\u306e\u304c\u9ad8\u4fa1\u306a\u8c6a\u90b8\u3092\u8cfc\u5165\u3057\u306a\u3044\u4eba\u3005\u306a\u3089\u3001\u305d\u306e\u3088\u3046\u306a\u5916\u308c\u5024\u3092\u524a\u9664\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u3057\u304b\u3057\u3001\u6bcd\u96c6\u56e3\u306b\u3053\u306e\u3088\u3046\u306a\u9ad8\u4fa1\u306a\u4f4f\u5b85\u3092\u8cfc\u5165\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3068\u5408\u7406\u7684\u306b\u8003\u3048\u3089\u308c\u308b\u4eba\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u306a\u3089\u3001\u3053\u306e\u3088\u3046\u306a\u5916\u308c\u5024\u306f\u6bcd\u96c6\u56e3\u306b\u95a2\u9023\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u6b8b\u3059\u3079\u304d\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u7bb1\u3072\u3052\u56f3\u3092\u5916\u308c\u5024\u306e\u7279\u5b9a\u65b9\u6cd5\u3068\u3057\u3066\u53d6\u308a\u4e0a\u3052\u3066\u3044\u307e\u3059\u304c\u3001\u6563\u5e03\u56f3\u3084\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0\u306a\u3069\u306e\u4ed6\u306e\u65b9\u6cd5\u3067\u3082\u30c7\u30fc\u30bf\u306b\u5916\u308c\u5024\u304c\u542b\u307e\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u7d20\u65e9\u304f\u78ba\u8a8d\u3057\u3001\u5916\u308c\u5024\u306b\u5bfe\u51e6\u3059\u3079\u304d\u304b\u3069\u3046\u304b\u3092\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u5224\u65ad\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5916\u308c\u5024\u306e\u89e3\u6c7a\u65b9\u6cd5\u306f\u4e00\u822c\u7684\u306b 2 \u3064\u306b\u5206\u985e\u3055\u308c\u307e\u3059\u3002\u5916\u308c\u5024\u3092\u524a\u9664\u3059\u308b\u304b\u3001\u5916\u308c\u5024\u306b\u3042\u307e\u308a\u5f71\u97ff\u3092\u53d7\u3051\u306a\u3044\u8981\u7d04\u7d71\u8a08\u3092\u4f7f\u7528\u3059\u308b\u304b\u306e 2 \u3064\u3067\u3059\u3002 \u524d\u8005\u306e\u5834\u5408\u3001\u5916\u308c\u5024\u304c\u5b9f\u969b\u306b\u3069\u306e\u884c\u3067\u3042\u308b\u304b\u3092\u77e5\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u307e\u3067\u306f\u5916\u308c\u5024\u3092\u8996\u899a\u7684\u306b\u7279\u5b9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u3066\u304d\u307e\u3057\u305f\u3002 \u3069\u306e\u89b3\u6e2c\u5024\u304c\u5916\u308c\u5024\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u306b\u306f\u3055\u307e\u3056\u307e\u306a\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002 \u4e00\u822c\u7684\u306a\u65b9\u6cd5\u306e 1 \u3064\u306f\u3001<em>\u4fee\u6b63 Z \u30b9\u30b3\u30a2<\/em>\u3068\u3044\u3046\u624b\u6cd5\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002 Z \u30b9\u30b3\u30a2\u304c\u3069\u306e\u3088\u3046\u306a\u7406\u7531\u3067\u3069\u3046\u4fee\u6b63\u3055\u308c\u3066\u3044\u308b\u306e\u304b\u3092\u898b\u308b\u524d\u306b\u3001\u305d\u306e\u57fa\u672c\u7684\u306a\u5b9a\u7fa9\u304c\u4ee5\u4e0b\u3067\u3042\u308b\u3053\u3068\u3092\u77e5\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><em>Z \u30b9\u30b3\u30a2 =<\/em> (<em>\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306e\u5024<\/em> \u2013 <em>\u5e73\u5747\u5024<\/em>) \/ <em>\u6a19\u6e96\u504f\u5dee<\/em><\/p>\n<p>\u5916\u308c\u5024\u3092\u691c\u51fa\u3059\u308b\u305f\u3081\u306b Z \u30b9\u30b3\u30a2\u3092\u4fee\u6b63\u3059\u308b\u7406\u7531\u306f\u3001\u5e73\u5747\u5024\u3082\u6a19\u6e96\u504f\u5dee\u3082\u305d\u306e\u8a08\u7b97\u65b9\u6cd5\u306b\u3088\u3063\u3066\u306f\u5916\u308c\u5024\u306e\u5f71\u97ff\u3092\u53d7\u3051\u3084\u3059\u3044\u305f\u3081\u3067\u3059\u3002 \u4fee\u6b63 Z \u30b9\u30b3\u30a2\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><em>\u4fee\u6b63 Z \u30b9\u30b3\u30a2 =<\/em> (<em>\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306e\u5024<\/em> \u2013 <em>\u4e2d\u592e\u5024<\/em>) \/ <em>\u4e2d\u592e\u7d76\u5bfe<\/em><em>\u504f\u5dee<\/em><\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/pycharm\/2024\/10\/data-exploration-with-pandas\/#summary-statistics\">\u8981\u7d04\u7d71\u8a08<\/a>\u3092\u53d6\u308a\u4e0a\u3052\u305f\u969b\u306b\u5b66\u7fd2\u3057\u305f\u3088\u3046\u306b\u3001\u4e2d\u592e\u5024\u306f\u5916\u308c\u5024\u306e\u5f71\u97ff\u3092\u53d7\u3051\u307e\u305b\u3093\u3002 <em>\u4e2d\u592e\u7d76\u5bfe\u504f\u5dee<\/em>\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e<em>\u4e2d\u592e\u5024<\/em>\u304b\u3089\u306e\u7d76\u5bfe\u504f\u5dee\u306e<em>\u4e2d\u592e\u5024<\/em>\u3067\u3059\u3002 \u305f\u3068\u3048\u3070\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u4ee5\u4e0b\u306e\u5024\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>1, 2, 2, 2,<strong> 3<\/strong>, 3, 3, 5,9<\/p>\n<p>\u3053\u306e\u5834\u5408\u3001<em>\u4e2d\u592e\u5024<\/em>\u306f\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e2d\u592e\u306b\u3042\u308b\u5024\u3067\u3042\u308b 3 \u306b\u306a\u308a\u307e\u3059\u3002 \u4e2d\u592e\u5024\u3067\u3042\u308b 3 \u304b\u3089\u306e\u504f\u5dee\u306f\u3001\u4e0a\u8a18\u306e\u9806\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>2, 1, 1, 1, 0, 0, 0, 2, 5<\/p>\n<p>\u3053\u308c\u3089\u306e\u5024\u3092\u6607\u9806\u306b\u4e26\u3079\u66ff\u3048\u307e\u3059\u3002<\/p>\n<p>0, 0, 0, 1, <strong>1<\/strong>, 1, 2, 2, 5<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u3001\u3053\u306e\u4f8b\u3067\u306e<em>\u4e2d\u592e\u7d76\u5bfe\u504f\u5dee<\/em>\u306f 1 \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u306e\u4f8b\u306b\u4f7f\u7528\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306f\u3001SalePrice \u306e\u4fee\u6b63 Z \u30b9\u30b3\u30a2\u3092\u3069\u306e\u3088\u3046\u306b\u6c42\u3081\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u304b\uff1f JetBrains AI \u306b\u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><em>Given:<\/em><\/p>\n<p><em>Modified Z-score = (data point value \u2013 median) \/ median absolute deviation<\/em><\/p>\n<p><em>Calculate the Modified Z-score for <\/em><em>#SalePrice<\/em><em>\u00a0<\/em><\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pandas as pd\nfrom scipy.stats import median_abs_deviation\n\n\n# Assuming 'data' is your DataFrame and it contains the 'SalePrice' column\n\n\n# Calculate the median for the SalePrice column\nmedian_sale_price = data['SalePrice'].median()\n\n\n# Calculate the Median Absolute Deviation (MAD) for the SalePrice column\nmad_sale_price = median_abs_deviation(data['SalePrice'], scale='normal')\n\n\n# Calculate the Modified Z-scores for the SalePrice column\ndata['Modified_Z_Score'] = (data['SalePrice'] - median_sale_price) \/ mad_sale_price\n\n\n# Display the first few rows with the Modified Z-scores\nprint(data[['SalePrice', 'Modified_Z_Score']].head())<\/pre>\n<p>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u76ee\u7684\u3092\u9014\u4e2d\u307e\u3067\u679c\u305f\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u6b21\u306f SalePrice \u306e\u5916\u308c\u5024\u304c\u4f55\u3067\u3042\u308b\u304b\u3092\u4fee\u6b63 Z \u30b9\u30b3\u30a2\u306b\u57fa\u3065\u3044\u3066\u5224\u65ad\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u3053\u3067\u306f\u4e00\u822c\u5e38\u8b58\u306b\u5f93\u3063\u3066\u5916\u308c\u5024\u3092 &gt;=3 \u307e\u305f\u306f &lt;=-3 \u3068\u3057\u307e\u3059\u304c\u3001\u307b\u3068\u3093\u3069\u306e\u7d71\u8a08\u7684\u6c7a\u5b9a\u3068\u540c\u69d8\u306b\u3001\u5916\u308c\u5024\u306f\u4f7f\u7528\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5408\u308f\u305b\u3066\u8abf\u6574\u3067\u304d\u3001\u305d\u3046\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 &lt;=-3 however, it\u2019s worth noting that like most statistical decisions, it can and should be tailored to your dataset. \u51fa\u529b\u3092\u3055\u3089\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u305f\u3081\u3001JetBrains AI \u306b\u5225\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u6e21\u3057\u307e\u3057\u3087\u3046\u3002 <em>Just list those that have a <\/em><em>#Modified_Z_Score<\/em><em> of 3 or above or -3 or below\u00a0<\/em><\/p>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3092\u63a1\u7528\u3057\u3001\u4e0a\u8a18\u306e\u95a2\u9023\u3059\u308b\u884c\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Filter the rows where the Modified Z-score is 3 or above, or -3 or below\noutliers = data[(data['Modified_Z_Score'] &gt;= 3) | (data['Modified_Z_Score'] &lt;= -3)]\n\n\n# Print all the filtered rows, showing their index and SalePrice\noutliers = (outliers[['SalePrice', 'Modified_Z_Score']])\noutliers<\/pre>\n<p>&#8220;outliers&#8221; \u3068\u3044\u3046\u65b0\u3057\u3044 DataFrame \u306b\u5916\u308c\u5024\u3092\u683c\u7d0d\u3057\u3001\u305d\u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u5185\u5bb9\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u306b\u3053\u306e\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u5916\u308c\u5024\u3092 DataFrame \u304b\u3089\u524a\u9664\u3057\u307e\u3059\u3002 \u3053\u3053\u3067\u3082 JetBrains AI \u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3001\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><em>Create a new dataframe without the outliers\u00a0<\/em><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">data_without_outliers = data.drop(index=outliers.index)\n\n\n# Display the new DataFrame without outliers\nprint(data_without_outliers)<\/pre>\n<p>&#8220;data_without_outliers&#8221; \u3068\u3044\u3046\u65b0\u3057\u3044 DataFrame \u3067\u306f\u3001SalePrice \u306e\u5909\u6570\u304c\u5916\u308c\u5024\u3068\u898b\u306a\u3055\u308c\u308b\u5024\u304c\u9664\u5916\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u7bb1\u3072\u3052\u56f3\u306e\u30b3\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u3066\u65b0\u3057\u3044 DataFrame \u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \u4e88\u60f3\u3057\u3066\u3044\u305f\u901a\u308a\u3001\u6b63\u306e\u6b6a\u307f\u306f\u4f9d\u7136\u3068\u3057\u3066\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5916\u308c\u5024\u3068\u3057\u3066\u898b\u306a\u3055\u308c\u308b\u5024\u306f\u9664\u53bb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import seaborn as sns\nimport matplotlib.pyplot as plt\n\n\n# Create a box plot for SalePrice\nplt.figure(figsize=(10, 6))\nsns.boxplot(x=data_without_outliers['SalePrice'])\nplt.title('Box Plot of SalePrice')\nplt.xlabel('SalePrice')\nplt.show()<\/pre>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-536450\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2025\/01\/image-1.png\" alt=\"\" width=\"1572\" height=\"1076\" \/><\/figure>\n<p>\u3053\u3053\u3067\u7d42\u308f\u308b\u524d\u306b\u3001SalePrice \u306b\u57fa\u3065\u3044\u3066\u5916\u308c\u5024\u3068\u898b\u306a\u3057\u305f\u3053\u3068\u3067 DataFrame \u304b\u3089\u9664\u53bb\u3055\u308c\u305f\u89b3\u6e2c\u5024\u306e\u6570\u3092\u30d1\u30fc\u30bb\u30f3\u30c8\u7387\u3067\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><em>Calculate the percentage of observations removed between #data and #data_without_outliers<\/em><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Calculate the number of observations in the original and filtered DataFrames\noriginal_count = len(data)\nfiltered_count = len(data_without_outliers)\n\n# Calculate the number of removed observations\nremoved_count = original_count - filtered_count\n\n# Calculate the percentage of observations removed\npercentage_removed = (removed_count \/ original_count) * 100\n\n# Display the percentage\nprint(f\"Percentage of observations removed: {percentage_removed:.2f}%\")<\/pre>\n<p>PyCharm \u306b\u3088\u308a\u30015.67% \u306e\u89b3\u6e2c\u5024\u304c\u9664\u53bb\u3055\u308c\u305f\u3053\u3068\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u524d\u8ff0\u306e\u3088\u3046\u306b\u3001\u5916\u308c\u5024\u3092\u6b8b\u3059\u5834\u5408\u306f\u3001\u5916\u308c\u5024\u306e\u5f71\u97ff\u3092\u53d7\u3051\u306b\u304f\u3044<em>\u4e2d\u592e\u5024<\/em>\u3084<em>\u56db\u5206\u4f4d\u7bc4\u56f2<\/em>\u306a\u3069\u306e\u8981\u7d04\u5024\u3092\u4f7f\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002 \u5b9a\u7fa9\u3057\u305f\u6bcd\u96c6\u56e3\u3068\u5c0e\u304d\u51fa\u3059\u7d50\u8ad6\u306b\u95a2\u9023\u6027\u304c\u3042\u308b\u305f\u3081\u306b\u9664\u53bb\u3057\u3066\u3044\u306a\u3044\u5916\u308c\u5024\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u3001\u305d\u308c\u3089\u306e\u6e2c\u5b9a\u5024\u3092\u4f7f\u7528\u3057\u3066\u7d50\u8ad6\u3092\u51fa\u3059\u3053\u3068\u3092\u691c\u8a0e\u3059\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u6b20\u640d\u5024<\/h3>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u6b20\u640d\u5024\u3092\u6700\u3082\u7d20\u65e9\u304f\u7279\u5b9a\u3059\u308b\u65b9\u6cd5\u306f\u3001\u8981\u7d04\u7d71\u8a08\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002 \u5ff5\u306e\u305f\u3081\u3001DataFrame \u5185\u3067\u53f3\u5074\u306b\u3042\u308b <em>Show Column Statistics<\/em>\uff08\u5217\u7d71\u8a08\u306e\u8868\u793a\uff09\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304b\u3089 <em>Compact<\/em>\uff08\u30b3\u30f3\u30d1\u30af\u30c8\uff09\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 <a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">Ames housing \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u306e Lot Frontage \u3067\u5206\u304b\u308b\u3088\u3046\u306b\u3001\u5217\u306e\u6b20\u640d\u5024\u306f\u8d64\u8272\u3067\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2025\/09\/AD_4nXdeSNdJvl9sk5Z8QXEJCr5rhDMI5GTGmaRdqvkIufNS8QZNQi-1QwDF1LQgTS_e9vm0B-pSKa5o2aZnNZEmPiAzvoaOjvRxmOICDRzuM_0iWumPGH_UWyR07Q8xTrzIUnYvL7-j-4.png\" width=\"624\" height=\"123\" \/><\/p>\n<p>\u3053\u306e\u30c7\u30fc\u30bf\u306b\u95a2\u3057\u3066\u691c\u8a0e\u3059\u3079\u304d\u6b20\u640d\u306b\u306f\u4ee5\u4e0b\u306e 3 \u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d<\/li>\n<li>\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d<\/li>\n<li>\u30e9\u30f3\u30c0\u30e0\u3067\u306a\u3044\u6b20\u640d<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">\u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d<\/h3>\n<p>\u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d\u3068\u306f\u3001\u5b8c\u5168\u306b\u5076\u767a\u7684\u306b\u30c7\u30fc\u30bf\u304c\u6b20\u843d\u3057\u3066\u304a\u308a\u3001\u6b20\u843d\u306e\u539f\u56e0\u304c\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u4ed6\u306e\u5909\u6570\u3068\u7121\u95a2\u4fc2\u3067\u3042\u308b\u3053\u3068\u3092\u6307\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001\u30a2\u30f3\u30b1\u30fc\u30c8\u306e\u8cea\u554f\u306b\u56de\u7b54\u6f0f\u308c\u304c\u3042\u308b\u5834\u5408\u306a\u3069\u306b\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d\u30c7\u30fc\u30bf\u306f\u307e\u308c\u306b\u3057\u304b\u767a\u751f\u3057\u307e\u305b\u3093\u304c\u3001\u6700\u3082\u5bfe\u51e6\u3057\u3084\u3059\u3044\u3082\u306e\u3067\u3082\u3042\u308a\u307e\u3059\u3002 \u5b8c\u5168\u306b\u30e9\u30f3\u30c0\u30e0\u306b\u6b20\u640d\u3057\u3066\u3044\u308b\u89b3\u6e2c\u5024\u306e\u6570\u304c\u6bd4\u8f03\u7684\u5c11\u6570\u3067\u3042\u308b\u5834\u5408\u306f\u3001\u305d\u306e\u3088\u3046\u306a\u89b3\u6e2c\u5024\u3092\u524a\u9664\u3059\u308b\u306e\u304c\u6700\u3082\u4e00\u822c\u7684\u306a\u5bfe\u51e6\u6cd5\u3067\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u89b3\u6e2c\u5024\u306f\u524a\u9664\u3057\u3066\u3082\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u6574\u5408\u6027\u306b\u5f71\u97ff\u3059\u308b\u3053\u3068\u306f\u306a\u304f\u3001\u5c0e\u304d\u51fa\u305d\u3046\u3068\u3057\u3066\u3044\u308b\u7d50\u8ad6\u306b\u3082\u5f71\u97ff\u3057\u306a\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d<\/h3>\n<p>\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d\u306b\u306f\u6b20\u640d\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u306a\u3055\u305d\u3046\u306b\u898b\u3048\u3066\u3082\u3001\u6e2c\u5b9a\u3057\u305f\u4ed6\u306e\u5909\u6570\u304b\u3089\u30d1\u30bf\u30fc\u30f3\u3092\u8aac\u660e\u3067\u304d\u308b\u6b20\u640d\u3092\u6307\u3057\u307e\u3059\u3002 \u305f\u3068\u3048\u3070\u3001\u30c7\u30fc\u30bf\u306e\u53ce\u96c6\u65b9\u6cd5\u304c\u539f\u56e0\u3067\u30a2\u30f3\u30b1\u30fc\u30c8\u306e\u8cea\u554f\u306b\u56de\u7b54\u6f0f\u308c\u304c\u3042\u3063\u305f\u5834\u5408\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">Ames housing \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u3092\u3082\u3046\u4e00\u5ea6\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002Lot Frontage \u5909\u6570\u306f\u3001\u7279\u5b9a\u306e\u4e0d\u52d5\u7523\u4f1a\u793e\u304c\u8ca9\u58f2\u3057\u305f\u4f4f\u5b85\u3067\u306f\u6b20\u640d\u306e\u983b\u5ea6\u304c\u9ad8\u304f\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u3053\u306e\u5834\u5408\u3001\u3053\u306e\u6b20\u640d\u306f\u4e0d\u52d5\u7523\u4f1a\u793e\u304c\u5165\u529b\u3057\u305f\u30c7\u30fc\u30bf\u306b\u6574\u5408\u6027\u304c\u306a\u3044\u3053\u3068\u304c\u539f\u56e0\u3060\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002 \u305d\u308c\u304c\u4e8b\u5b9f\u3067\u3042\u308b\u5834\u5408\u3001Lot Frontage \u30c7\u30fc\u30bf\u304c\u6b20\u640d\u3057\u3066\u3044\u308b\u3053\u3068\u306f Lot Frontage \u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f\u3001\u7269\u4ef6\u3092\u8ca9\u58f2\u3057\u305f\u4e0d\u52d5\u7523\u4f1a\u793e\u306b\u3088\u308b\u30c7\u30fc\u30bf\u53ce\u96c6\u65b9\u6cd5\uff08\u89b3\u6e2c\u5bfe\u8c61\u306e\u7279\u6027\uff09\u306b\u95a2\u9023\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u304c\u30e9\u30f3\u30c0\u30e0\u306b\u6b20\u640d\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u30c7\u30fc\u30bf\u304c\u6b20\u640d\u3057\u3066\u3044\u308b\u7406\u7531\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u306f\u591a\u304f\u306e\u5834\u5408\u3001\u30c7\u30fc\u30bf\u306e\u53ce\u96c6\u65b9\u6cd5\u3092\u8abf\u3079\u308b\u4f5c\u696d\u304c\u4f34\u3044\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u304c\u6b20\u640d\u3057\u3066\u3044\u308b\u7406\u7531\u3092\u7406\u89e3\u3057\u305f\u3089\u3001\u5bfe\u51e6\u6cd5\u3092\u9078\u629e\u3067\u304d\u307e\u3059\u3002 \u6bd4\u8f03\u7684\u3088\u304f\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u30e9\u30f3\u30c0\u30e0\u306a\u6b20\u640d\u306e\u5bfe\u51e6\u6cd5\u306b\u306f\u3001\u5024\u306e\u4ee3\u5165\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u5bfe\u51e6\u6cd5\u306f\u3042\u308a\u5f97\u306a\u3044\u5024\u306b\u95a2\u3057\u3066\u3059\u3067\u306b\u89e6\u308c\u307e\u3057\u305f\u304c\u3001\u6b20\u640d\u306b\u3082\u6709\u52b9\u3067\u3059\u3002 \u3053\u306e\u4f8b\u3067\u8a00\u3048\u3070\u3001\u4f4f\u5b85\u306e\u898f\u6a21\u3001\u5efa\u7bc9\u5e74\u3001\u8ca9\u58f2\u4fa1\u683c\u306a\u3069\u306e\u76f8\u95a2\u5909\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u542b\u3081\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u6bcd\u96c6\u56e3\u3068\u5c0e\u304d\u51fa\u3057\u305f\u3044\u7d50\u8ad6\u306b\u5fdc\u3058\u3066\u3055\u307e\u3056\u307e\u306a\u9078\u629e\u80a2\u304c\u3042\u308a\u307e\u3059\u3002 \u6b20\u640d\u30c7\u30fc\u30bf\u306e\u539f\u56e0\u3068\u306a\u3063\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u7406\u89e3\u3059\u308b\u306b\u306f\u3001\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u60c5\u5831\u3092\u4f7f\u7528\u3057\u3066\u5024\u3092\u4ee3\u5165\u3067\u304d\u308b\u3053\u3068\u3082\u3057\u3070\u3057\u3070\u3067\u3059\u3002\u305d\u308c\u306b\u3088\u308a\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u30c7\u30fc\u30bf\u9593\u306e\u95a2\u9023\u304c\u7dad\u6301\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u30e9\u30f3\u30c0\u30e0\u3067\u306a\u3044\u6b20\u640d<\/h3>\n<p>\u6700\u5f8c\u306b\u53d6\u308a\u4e0a\u3052\u308b\u30e9\u30f3\u30c0\u30e0\u3067\u306a\u3044\u6b20\u640d\u306f\u3001\u30c7\u30fc\u30bf\u304c\u6b20\u640d\u3059\u308b\u53ef\u80fd\u6027\u304c\u89b3\u6e2c\u5bfe\u8c61\u5916\u306e\u30c7\u30fc\u30bf\u306b\u95a2\u9023\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u767a\u751f\u3057\u307e\u3059\u3002 \u3064\u307e\u308a\u3001\u6b20\u640d\u304c\u672a\u89b3\u6e2c\u306e\u30c7\u30fc\u30bf\u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3082\u3046\u4e00\u5ea6 <a href=\"https:\/\/www.kaggle.com\/datasets\/prevek18\/ames-housing-dataset\" target=\"_blank\" rel=\"noopener\">Ames housing \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8<\/a>\u306b\u623b\u308a\u3001Lot Frontage \u306b\u6b20\u640d\u30c7\u30fc\u30bf\u304c\u3042\u308b\u4e8b\u5b9f\u306b\u76ee\u3092\u5411\u3051\u307e\u3057\u3087\u3046\u3002 \u30c7\u30fc\u30bf\u306e\u6b20\u640d\u304c\u30e9\u30f3\u30c0\u30e0\u3067\u306a\u3044\u72b6\u6cc1\u3068\u3057\u3066\u306f\u3001\u8ca9\u58f2\u8005\u304c Lot Frontage \u3092<em>\u5c0f\u3055\u3044<\/em>\u3068\u898b\u306a\u3057\u3001\u305d\u308c\u3092\u5831\u544a\u3059\u308b\u3053\u3068\u3067\u4f4f\u5b85\u306e\u8ca9\u58f2\u4fa1\u683c\u304c\u4e0b\u304c\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u3092\u6050\u308c\u3066\u610f\u56f3\u7684\u306b\u5831\u544a\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002 Lot Frontage \u30c7\u30fc\u30bf\u304c\u6b20\u640d\u3057\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u9593\u53e3\u305d\u306e\u3082\u306e\u306e\u898f\u6a21\uff08\u89b3\u6e2c\u5bfe\u8c61\u5916\uff09\u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u9593\u53e3\u304c\u5c0f\u3055\u3044\u307b\u3069\u5831\u544a\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u4f4e\u304f\u3001\u6b20\u640d\u304c\u76f4\u63a5\u6b20\u640d\u5024\u306b\u95a2\u9023\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u6b20\u640d\u306e\u53ef\u8996\u5316<\/h3>\n<p>\u30c7\u30fc\u30bf\u304c\u6b20\u640d\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u30c7\u30fc\u30bf\u3092\u4e00\u822c\u5316\u3059\u308b\u524d\u306b\u5bfe\u51e6\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u53ef\u80fd\u6027\u306e\u3042\u308b\u554f\u984c\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d1\u30bf\u30fc\u30f3\u3092\u6700\u3082\u7c21\u5358\u306b\u63a2\u3059\u306b\u306f\u3001\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u53ef\u8996\u5316\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u30b3\u30fc\u30c9\u306b\u7740\u624b\u3059\u308b\u524d\u306b\u3001\u6b20\u640d\u306e\u306a\u3044\u5909\u6570\u3092\u9664\u5916\u3057\u307e\u3057\u3087\u3046\u3002 JetBrains AI \u306b\u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u9001\u308b\u3068\u3001\u5fc5\u8981\u306a\u30b3\u30fc\u30c9\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<p><em>Code to create a new dataframe that contains only columns with missingness\u00a0<\/em><\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Identify columns with any missing values\ncolumns_with_missing = data.columns[data.isnull().any()]\n\n# Create a new DataFrame with only columns that have missing values\ndata_with_missingness = data[columns_with_missing]\n\n# Display the new DataFrame\nprint(data_with_missingness)<\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u6700\u5f8c\u306e\u884c\u3092\u5909\u66f4\u3057\u3066 PyCharm \u306e\u7d20\u6674\u3089\u3057\u3044 DataFrame \u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">data_with_missingness<\/pre>\n<p>\u3067\u306f\u3001\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u3082 JetBrains AI \u306b\u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u9001\u4fe1\u3057\u3066\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><em>Create a heatmap of <\/em><em>#data_with_missingness<\/em><em> that is transposed<\/em><\/p>\n<p>\u4ee5\u4e0b\u306e\u7d50\u679c\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import seaborn as sns\nimport matplotlib.pyplot as plt\n\n\n# Transpose the data_with_missingness DataFrame\ntransposed_data = data_with_missingness.T\n\n\n# Create a heatmap to visualize missingness\nplt.figure(figsize=(12, 8))\nsns.heatmap(transposed_data.isnull(), cbar=False, yticklabels=True)\nplt.title('Missing Data Heatmap (Transposed)')\nplt.xlabel('Instances')\nplt.ylabel('Features')\nplt.tight_layout()\nplt.show()<\/pre>\n<p>\u306a\u304a\u3001heatmap \u306e\u5f15\u6570\u304b\u3089 cmap=\u2019viridis\u2019 \u3092\u9664\u53bb\u3057\u307e\u3057\u305f\u3002\u305d\u308c\u3092\u4f7f\u3046\u3068\u898b\u306b\u304f\u304f\u306a\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-537110\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2025\/01\/image-24.png\" alt=\"\" width=\"1600\" height=\"1065\" \/><\/figure>\n<p>\u3053\u306e\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u3067\u306f\u3001\u540c\u3058\u5909\u6570\u304c\u8907\u6570\u306e\u884c\u306b\u308f\u305f\u3063\u3066\u6b20\u640d\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u6b20\u640d\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308b\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002 \u3042\u308b\u30b0\u30eb\u30fc\u30d7\u3067\u306f\u3001Bsmt Qual\u3001Bsmt Cond\u3001Bsmt Exposure\u3001BsmtFin Type 1\u3001\u304a\u3088\u3073Bsmt Fin Type 2 \u304c\u540c\u3058\u89b3\u6e2c\u5024\u304b\u3089\u3059\u3079\u3066\u6b20\u640d\u3057\u3066\u3044\u308b\u306e\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u5225\u306e\u30b0\u30eb\u30fc\u30d7\u3067\u306f\u3001Garage Type\u3001Garage Yr Bit\u3001Garage Finish\u3001Garage Qual\u3001Garage Cond \u304c\u540c\u3058\u89b3\u6e2c\u5024\u304b\u3089\u3059\u3079\u3066\u6b20\u640d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u5909\u6570\u306f\u3059\u3079\u3066\u5730\u4e0b\u5ba4\u3068\u8eca\u5eab\u306b\u95a2\u9023\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u6b20\u640d\u3057\u3066\u3044\u306a\u3044\u3001\u8eca\u5eab\u307e\u305f\u306f\u5730\u4e0b\u5ba4\u306b\u95a2\u9023\u3059\u308b\u4ed6\u306e\u5909\u6570\u3082\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u6b20\u640d\u3092\u8aac\u660e\u3059\u308b\u3068\u3059\u308c\u3070\u3001\u30c7\u30fc\u30bf\u304c\u53ce\u96c6\u3055\u308c\u305f\u969b\u306b\u5225\u3005\u306e\u4e0d\u52d5\u7523\u4f1a\u793e\u3067\u8eca\u5eab\u3068\u5730\u4e0b\u5ba4\u306b\u95a2\u3059\u308b\u5225\u3005\u306e\u8cea\u554f\u304c\u554f\u308f\u308c\u305f\u3082\u306e\u306e\u3001\u305d\u306e\u4e2d\u306b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3042\u308b\u3082\u306e\u307b\u3069\u8a73\u3057\u304f\u8a18\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u30c7\u30fc\u30bf\u304c\u3042\u308b\u5834\u5408\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002 \u3053\u306e\u3088\u3046\u306a\u72b6\u6cc1\u306f\u81ea\u5206\u3067\u53ce\u96c6\u3057\u3066\u3044\u306a\u3044\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u306b\u306f\u3088\u304f\u767a\u751f\u3059\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u6b20\u640d\u3092\u8a73\u3057\u304f\u77e5\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u30c7\u30fc\u30bf\u306e\u53ce\u96c6\u65b9\u6cd5\u3092\u8abf\u3079\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9 \u2013 \u52b9\u7387\u7684\u306a\u524d\u51e6\u7406\u306e\u30b3\u30c4<\/h2>\n<p>\u524d\u8ff0\u306e\u3088\u3046\u306b\u3001\u6bcd\u96c6\u56e3\u306e\u5b9a\u7fa9\u306f\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306e\u4e2d\u3067\u3082\u7279\u306b\u512a\u5148\u3059\u3079\u304d\u4e8b\u9805\u3067\u3059\u3002 \u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3092\u59cb\u3081\u308b\u524d\u306b\u3001\u4f55\u3092\u9054\u6210\u3057\u305f\u3044\u306e\u304b\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u4e00\u822c\u5316\u3057\u305f\u3044\u306e\u304b\u3092\u77e5\u3063\u3066\u304a\u304f\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<p>\u3059\u3079\u3066\u306e\u65b9\u6cd5\u304c\u518d\u73fe\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u305c\u306a\u3089\u3001\u518d\u73fe\u6027\u306f\u30af\u30ea\u30fc\u30f3\u306a\u30c7\u30fc\u30bf\u306b\u3082\u95a2\u9023\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002 \u518d\u73fe\u3067\u304d\u306a\u3044\u72b6\u6cc1\u3060\u3068\u3001\u5f8c\u7d9a\u306e\u4f5c\u696d\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u304b\u306d\u307e\u305b\u3093\u3002 \u3053\u306e\u305f\u3081\u3001Jupyter \u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u3092\u6574\u7406\u3057\u3066\u9806\u5e8f\u3092\u7dad\u6301\u3057\u3001\u3059\u3079\u3066\u306e\u30b9\u30c6\u30c3\u30d7\u3067\uff08\u7279\u306b\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3067\u306f\uff09Markdown \u6a5f\u80fd\u3092\u6d3b\u7528\u3057\u3066\u610f\u601d\u6c7a\u5b9a\u3092\u6587\u66f8\u5316\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u3059\u308b\u969b\u306b\u306f\u6bb5\u968e\u7684\u306b\u4f5c\u696d\u3092\u9032\u3081\u3001\u5143\u306e CSV \u30d5\u30a1\u30a4\u30eb\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u306f\u306a\u304f DataFrame \u3092\u4fee\u6b63\u3059\u308b\u3088\u3046\u306b\u3057\u3001\u518d\u73fe\u53ef\u80fd\u3067\u5341\u5206\u306b\u6587\u66f8\u5316\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3067\u3059\u3079\u3066\u3092\u5b9f\u65bd\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081 \u2013 \u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306e\u91cd\u8981\u6027<\/h2>\n<p>\u30c7\u30fc\u30bf\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u306f\u5927\u304d\u306a\u30c6\u30fc\u30de\u3067\u3042\u308a\u3001\u591a\u304f\u306e\u8ab2\u984c\u306b\u76f4\u9762\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u5927\u304d\u304f\u306a\u308b\u307b\u3069\u3001\u30af\u30ea\u30fc\u30cb\u30f3\u30b0\u30d7\u30ed\u30bb\u30b9\u3082\u56f0\u96e3\u306b\u306a\u308a\u307e\u3059\u3002 \u6bcd\u96c6\u56e3\u3092\u5ff5\u982d\u306b\u7f6e\u304d\u3001\u6b20\u640d\u5024\u306e\u9664\u53bb\u3068\u4ee3\u5165\u306e\u3069\u3061\u3089\u3092\u512a\u5148\u3059\u3079\u304d\u304b\u3092\u8003\u616e\u3057\u3066\u305d\u308c\u3089\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u4fdd\u3061\u3001\u30c7\u30fc\u30bf\u304c\u5143\u3005\u6b20\u640d\u3057\u3066\u3044\u308b\u7406\u7531\u3092\u7406\u89e3\u3057\u306a\u304c\u3089\u3001\u7d50\u8ad6\u3092\u3088\u308a\u5e83\u7bc4\u306b\u4e00\u822c\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u81ea\u5206\u81ea\u8eab\u3092\u30c7\u30fc\u30bf\u306e\u58f0\u3068\u3057\u3066\u8003\u3048\u307e\u3057\u3087\u3046\u3002 \u30c7\u30fc\u30bf\u304c\u305f\u3069\u3063\u3066\u304d\u305f\u904e\u7a0b\u3084\u3001\u3042\u3089\u3086\u308b\u6bb5\u968e\u3067\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u3092\u3069\u306e\u3088\u3046\u306b\u7dad\u6301\u3057\u3066\u304d\u305f\u304b\u3092\u7406\u89e3\u3057\u3066\u3044\u308b\u306e\u306f\u3042\u306a\u305f\u81ea\u8eab\u3067\u3059\u3002 \u305d\u306e\u904e\u7a0b\u3092\u6587\u66f8\u5316\u3057\u3001\u4ed6\u306e\u4eba\u306b\u5171\u6709\u3059\u308b\u306e\u306b\u6700\u9069\u306a\u4eba\u7269\u306f\u3042\u306a\u305f\u3067\u3059\u3002<\/p>\n<p align=\"center\"><a class=\"jb-download-button\" href=\"https:\/\/jb.gg\/m8p92h\" target=\"_blank\" rel=\"noopener\"><br \/>PyCharm Professional \u3092\u7121\u6599\u3067\u8a66\u3059<br \/><\/a><\/p>\n\n\n<p><strong>\u30aa\u30ea\u30b8\u30ca\u30eb\uff08\u82f1\u8a9e\uff09\u30d6\u30ed\u30b0\u6295\u7a3f\u8a18\u4e8b\u306e\u4f5c\u8005\uff1a<\/strong><\/p>\n\n\n    <div class=\"about-author \">\n        <div class=\"about-author__box\">\n            <div class=\"row\">\n                <div class=\"about-author__box-img\">\n                    <img decoding=\"async\" src=\"https:\/\/secure.gravatar.com\/avatar\/193dd3accbb2e467f1b46a7f38ea929d?s=200&#038;r=g\" width=\"200\" height=\"200\" alt=\"Helen Scott\" loading=\"lazy\"  class=\"avatar avatar-200 wp-user-avatar wp-user-avatar-200 photo avatar-default\">\n                <\/div>\n                <div class=\"about-author__box-text\">\n                                            <h4>Helen Scott<\/h4>\n                                                        <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n","protected":false},"author":1150,"featured_media":553405,"comment_status":"closed","ping_status":"closed","template":"","categories":[952],"tags":[],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/pycharm\/553398"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/pycharm"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/types\/pycharm"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/users\/1150"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/comments?post=553398"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/pycharm\/553398\/revisions"}],"predecessor-version":[{"id":603773,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/pycharm\/553398\/revisions\/603773"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/media\/553405"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/media?parent=553398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/categories?post=553398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/tags?post=553398"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/cross-post-tag?post=553398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}