{"id":961,"date":"2023-07-28T04:33:25","date_gmt":"2023-07-28T04:33:25","guid":{"rendered":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/"},"modified":"2023-07-28T04:33:25","modified_gmt":"2023-07-28T04:33:25","slug":"python-ceyrekler-arasi-aralik","status":"publish","type":"post","link":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/","title":{"rendered":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Genellikle &#8220;IQR&#8221; olarak adland\u0131r\u0131lan <strong>\u00e7eyrekler aras\u0131<\/strong> <strong>aral\u0131k<\/strong> , bir veri k\u00fcmesinin ortadaki %50&#8217;lik k\u0131sm\u0131n\u0131n da\u011f\u0131l\u0131m\u0131n\u0131 \u00f6l\u00e7menin bir yoludur. Bir veri setinin ilk \u00e7eyre\u011fi* (y\u00fczde 25&#8217;inci dilim) ile \u00fc\u00e7\u00fcnc\u00fc \u00e7eyre\u011fi (y\u00fczde 75&#8217;inci dilim) aras\u0131ndaki fark olarak hesaplan\u0131r.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Neyse ki Python&#8217;da bir veri k\u00fcmesinin \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n\u0131 <a href=\"https:\/\/numpy.org\/doc\/stable\/reference\/generated\/numpy.percentile.html\" target=\"_blank\" rel=\"noopener noreferrer\">numpy.percentile()<\/a> i\u015flevini kullanarak hesaplamak kolayd\u0131r.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Bu e\u011fitimde bu i\u015flevin pratik kullan\u0131m\u0131na ili\u015fkin birka\u00e7 \u00f6rnek g\u00f6sterilmektedir.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u00d6rnek 1: bir tablonun \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, tek bir tabloda \u00e7eyrekler aras\u0131 de\u011fer aral\u0131\u011f\u0131n\u0131n nas\u0131l hesaplanaca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> numpy <span style=\"color: #107d3f;\">as<\/span> np\n\n<span style=\"color: #008080;\">#define array of data<\/span>\ndata = np.array([14, 19, 20, 22, 24, 26, 27, 30, 30, 31, 36, 38, 44, 47])\n\n<span style=\"color: #008080;\">#calculate interquartile range<\/span> \nq3, q1 = np. <span style=\"color: #3366ff;\">percentile<\/span> (data, [75,25])\niqr = q3 - q1\n\n<span style=\"color: #008080;\">#display interquartile range<\/span> \niqr\n\n12.25<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Bu veri setinin \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131 <strong>12,25<\/strong> olarak ortaya \u00e7\u0131k\u0131yor. Bu, bu veri k\u00fcmesindeki de\u011ferlerin ortadaki %50&#8217;sinin da\u011f\u0131l\u0131m\u0131d\u0131r.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u00d6rnek 2: Veri \u00c7er\u00e7evesi S\u00fctununun \u00c7eyrekler Aras\u0131 Aral\u0131\u011f\u0131<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, bir veri \u00e7er\u00e7evesindeki tek bir s\u00fctun i\u00e7in \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> numpy <span style=\"color: #107d3f;\">as<\/span> np\n<span style=\"color: #107d3f;\">import<\/span> pandas <span style=\"color: #107d3f;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#create data frame<\/span>\ndf = pd.DataFrame({'rating': [90, 85, 82, 88, 94, 90, 76, 75, 87, 86],\n                   'points': [25, 20, 14, 16, 27, 20, 12, 15, 14, 19],\n                   'assists': [5, 7, 7, 8, 5, 7, 6, 9, 9, 5],\n                   'rebounds': [11, 8, 10, 6, 6, 9, 6, 10, 10, 7]})\n\n<span style=\"color: #008080;\">#calculate interquartile range of values in the 'points' column<\/span>\nq75, q25 = np. <span style=\"color: #3366ff;\">percentile<\/span> (df['points'], [75,25])\niqr = q75 - q25\n\n<span style=\"color: #008080;\">#display interquartile range<\/span> \niqr\n\n5.75<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Puan s\u00fctunundaki de\u011ferlerin \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131 <strong>5,75<\/strong> olarak ortaya \u00e7\u0131k\u0131yor.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u00d6rnek 3: \u00c7oklu veri \u00e7er\u00e7evesi s\u00fctunlar\u0131n\u0131n \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, bir veri \u00e7er\u00e7evesindeki birden \u00e7ok s\u00fctunun \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n\u0131n ayn\u0131 anda nas\u0131l hesaplanaca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> numpy <span style=\"color: #107d3f;\">as<\/span> np\n<span style=\"color: #107d3f;\">import<\/span> pandas <span style=\"color: #107d3f;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#create data frame<\/span>\ndf = pd.DataFrame({'rating': [90, 85, 82, 88, 94, 90, 76, 75, 87, 86],\n                   'points': [25, 20, 14, 16, 27, 20, 12, 15, 14, 19],\n                   'assists': [5, 7, 7, 8, 5, 7, 6, 9, 9, 5],\n                   'rebounds': [11, 8, 10, 6, 6, 9, 6, 10, 10, 7]})\n\n<span style=\"color: #008080;\">#define function to calculate interquartile range\n<\/span><span style=\"color: #008000;\">def<\/span> find_iqr(x):\n  <span style=\"color: #008000;\">return<\/span> np. <span style=\"color: #3366ff;\">subtract<\/span> (*np. <span style=\"color: #3366ff;\">percentile<\/span> (x, [75, 25]))\n\n<span style=\"color: #008080;\">#calculate IQR for 'rating' and 'points' columns\n<\/span>df[[' <span style=\"color: #008000;\">rating<\/span> ', ' <span style=\"color: #008000;\">points<\/span> ']]. <span style=\"color: #3366ff;\">apply<\/span> (find_iqr)\n\nrating 6.75\npoints 5.75\ndtype:float64\n\n<span style=\"color: #008080;\">#calculate IQR for all columns\n<\/span>df. <span style=\"color: #3366ff;\">apply<\/span> (find_iqr)\n\nrating 6.75\npoints 5.75\nassists 2.50\nrebounds 3.75\ndtype:float64\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Not:<\/strong> Yukar\u0131daki veri \u00e7er\u00e7evesindeki birden \u00e7ok s\u00fctunun IQR&#8217;sini hesaplamak i\u00e7in <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.apply.html\" target=\"_blank\" rel=\"noopener noreferrer\">pandas.DataFrame.apply()<\/a> i\u015flevini kullan\u0131r\u0131z.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Ek kaynaklar<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/tr\/ceyrekler-arasi-aykiri-degerler\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u00c7eyrekler aras\u0131 aral\u0131k (IQR) ayk\u0131r\u0131 de\u011ferlerden etkileniyor mu?<\/a><br \/> <a href=\"https:\/\/statorials.org\/tr\/ceyrekler-arasi-aralik-excel\/\" target=\"_blank\" rel=\"noopener noreferrer\">Excel&#8217;de \u00c7eyrekler Aras\u0131 Aral\u0131k (IQR) Nas\u0131l Hesaplan\u0131r?<\/a><br \/> \u00c7eyrekler Aras\u0131 Aral\u0131k Hesaplay\u0131c\u0131<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Genellikle &#8220;IQR&#8221; olarak adland\u0131r\u0131lan \u00e7eyrekler aras\u0131 aral\u0131k , bir veri k\u00fcmesinin ortadaki %50&#8217;lik k\u0131sm\u0131n\u0131n da\u011f\u0131l\u0131m\u0131n\u0131 \u00f6l\u00e7menin bir yoludur. Bir veri setinin ilk \u00e7eyre\u011fi* (y\u00fczde 25&#8217;inci dilim) ile \u00fc\u00e7\u00fcnc\u00fc \u00e7eyre\u011fi (y\u00fczde 75&#8217;inci dilim) aras\u0131ndaki fark olarak hesaplan\u0131r. Neyse ki Python&#8217;da bir veri k\u00fcmesinin \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n\u0131 numpy.percentile() i\u015flevini kullanarak hesaplamak kolayd\u0131r. Bu e\u011fitimde bu i\u015flevin pratik [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-961","post","type-post","status-publish","format-standard","hentry","category-rehber"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python&#039;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r - Statorials<\/title>\n<meta name=\"description\" content=\"Python&#039;da \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131na dair basit bir a\u00e7\u0131klama.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python&#039;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r - Statorials\" \/>\n<meta property=\"og:description\" content=\"Python&#039;da \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131na dair basit bir a\u00e7\u0131klama.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T04:33:25+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/\",\"url\":\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/\",\"name\":\"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/tr\/#website\"},\"datePublished\":\"2023-07-28T04:33:25+00:00\",\"dateModified\":\"2023-07-28T04:33:25+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\"},\"description\":\"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131na dair basit bir a\u00e7\u0131klama.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ev\",\"item\":\"https:\/\/statorials.org\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/tr\/#website\",\"url\":\"https:\/\/statorials.org\/tr\/\",\"name\":\"Statorials\",\"description\":\"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/tr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil\",\"sameAs\":[\"https:\/\/statorials.org\/tr\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r - Statorials","description":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131na dair basit bir a\u00e7\u0131klama.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/","og_locale":"tr_TR","og_type":"article","og_title":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r - Statorials","og_description":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131na dair basit bir a\u00e7\u0131klama.","og_url":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/","og_site_name":"Statorials","article_published_time":"2023-07-28T04:33:25+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Dr.benjamin anderson","Tahmini okuma s\u00fcresi":"2 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/","url":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/","name":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/tr\/#website"},"datePublished":"2023-07-28T04:33:25+00:00","dateModified":"2023-07-28T04:33:25+00:00","author":{"@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48"},"description":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131\u011f\u0131n nas\u0131l hesaplanaca\u011f\u0131na dair basit bir a\u00e7\u0131klama.","breadcrumb":{"@id":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/tr\/python-ceyrekler-arasi-aralik\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ev","item":"https:\/\/statorials.org\/tr\/"},{"@type":"ListItem","position":2,"name":"Python&#39;da \u00e7eyrekler aras\u0131 aral\u0131k nas\u0131l hesaplan\u0131r"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/tr\/#website","url":"https:\/\/statorials.org\/tr\/","name":"Statorials","description":"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/tr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"tr"},{"@type":"Person","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil","sameAs":["https:\/\/statorials.org\/tr"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/comments?post=961"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/961\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/media?parent=961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/categories?post=961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/tags?post=961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}