{"id":958,"date":"2023-07-28T04:33:25","date_gmt":"2023-07-28T04:33:25","guid":{"rendered":"https:\/\/statorials.org\/de\/python-interquartilbereich\/"},"modified":"2023-07-28T04:33:25","modified_gmt":"2023-07-28T04:33:25","slug":"python-interquartilbereich","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/python-interquartilbereich\/","title":{"rendered":"So berechnen sie den interquartilbereich in python"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Der <strong>Interquartilbereich<\/strong> , oft \u201eIQR\u201c genannt, ist eine M\u00f6glichkeit <strong>,<\/strong> die Verteilung der mittleren 50 % eines Datensatzes zu messen. Sie wird als Differenz zwischen dem ersten Quartil* (dem 25. Perzentil) und dem dritten Quartil (dem 75. Perzentil) eines Datensatzes berechnet.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Gl\u00fccklicherweise ist es einfach, den Interquartilbereich eines Datensatzes in Python mit der Funktion <a href=\"https:\/\/numpy.org\/doc\/stable\/reference\/generated\/numpy.percentile.html\" target=\"_blank\" rel=\"noopener noreferrer\">numpy.percentile()<\/a> zu berechnen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Dieses Tutorial zeigt einige Beispiele f\u00fcr die praktische Verwendung dieser Funktion.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel 1: Interquartilbereich einer Tabelle<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie der Interquartilbereich von Werten in einer einzelnen Tabelle berechnet wird:<\/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;\">Der Interquartilbereich dieses Datensatzes betr\u00e4gt <strong>12,25<\/strong> . Dies ist die Verteilung der mittleren 50 % der Werte in diesem Datensatz.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel 2: Interquartilbereich einer Datenrahmenspalte<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie der Interquartilbereich f\u00fcr eine einzelne Spalte in einem Datenrahmen berechnet wird:<\/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;\">Der Interquartilbereich der Werte in der Punktespalte betr\u00e4gt <strong>5,75<\/strong> .<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel 3: Interquartilbereich mehrerer Datenrahmenspalten<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie der Interquartilbereich mehrerer Spalten in einem Datenrahmen gleichzeitig berechnet wird:<\/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>Hinweis:<\/strong> Wir verwenden die Funktion <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.apply.html\" target=\"_blank\" rel=\"noopener noreferrer\">pandas.DataFrame.apply()<\/a> , um den IQR f\u00fcr mehrere Spalten im obigen Datenrahmen zu berechnen.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Zus\u00e4tzliche Ressourcen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/de\/interquartil-ausreisser\/\" target=\"_blank\" rel=\"noopener noreferrer\">Wird der Interquartilbereich (IQR) durch Ausrei\u00dfer beeinflusst?<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/interquartilbereich-excel\/\" target=\"_blank\" rel=\"noopener noreferrer\">So berechnen Sie den Interquartilbereich (IQR) in Excel<\/a><br \/> Interquartilbereichsrechner<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Der Interquartilbereich , oft \u201eIQR\u201c genannt, ist eine M\u00f6glichkeit , die Verteilung der mittleren 50 % eines Datensatzes zu messen. Sie wird als Differenz zwischen dem ersten Quartil* (dem 25. Perzentil) und dem dritten Quartil (dem 75. Perzentil) eines Datensatzes berechnet. Gl\u00fccklicherweise ist es einfach, den Interquartilbereich eines Datensatzes in Python mit der Funktion numpy.percentile() [&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":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>So berechnen Sie den Interquartilbereich in Python - Statorials<\/title>\n<meta name=\"description\" content=\"Eine einfache Erkl\u00e4rung zur Berechnung des Interquartilbereichs in Python.\" \/>\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\/de\/python-interquartilbereich\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"So berechnen Sie den Interquartilbereich in Python - Statorials\" \/>\n<meta property=\"og:description\" content=\"Eine einfache Erkl\u00e4rung zur Berechnung des Interquartilbereichs in Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/python-interquartilbereich\/\" \/>\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=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr. Benjamin Anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/de\/python-interquartilbereich\/\",\"url\":\"https:\/\/statorials.org\/de\/python-interquartilbereich\/\",\"name\":\"So berechnen Sie den Interquartilbereich in Python - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-28T04:33:25+00:00\",\"dateModified\":\"2023-07-28T04:33:25+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"Eine einfache Erkl\u00e4rung zur Berechnung des Interquartilbereichs in Python.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/python-interquartilbereich\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/python-interquartilbereich\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/python-interquartilbereich\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"So berechnen sie den interquartilbereich in python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/de\/#website\",\"url\":\"https:\/\/statorials.org\/de\/\",\"name\":\"Statorials\",\"description\":\"Ihr Leitfaden f\u00fcr statistische Kompetenz !\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\",\"name\":\"Dr. Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. Benjamin Anderson\"},\"description\":\"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen\",\"sameAs\":[\"https:\/\/statorials.org\/de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"So berechnen Sie den Interquartilbereich in Python - Statorials","description":"Eine einfache Erkl\u00e4rung zur Berechnung des Interquartilbereichs in Python.","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\/de\/python-interquartilbereich\/","og_locale":"de_DE","og_type":"article","og_title":"So berechnen Sie den Interquartilbereich in Python - Statorials","og_description":"Eine einfache Erkl\u00e4rung zur Berechnung des Interquartilbereichs in Python.","og_url":"https:\/\/statorials.org\/de\/python-interquartilbereich\/","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":{"Verfasst von":"Dr. Benjamin Anderson","Gesch\u00e4tzte Lesezeit":"2 Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/de\/python-interquartilbereich\/","url":"https:\/\/statorials.org\/de\/python-interquartilbereich\/","name":"So berechnen Sie den Interquartilbereich in Python - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-28T04:33:25+00:00","dateModified":"2023-07-28T04:33:25+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"Eine einfache Erkl\u00e4rung zur Berechnung des Interquartilbereichs in Python.","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/python-interquartilbereich\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/python-interquartilbereich\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/python-interquartilbereich\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"So berechnen sie den interquartilbereich in python"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/de\/#website","url":"https:\/\/statorials.org\/de\/","name":"Statorials","description":"Ihr Leitfaden f\u00fcr statistische Kompetenz !","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"Person","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0","name":"Dr. Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Dr. Benjamin Anderson"},"description":"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen","sameAs":["https:\/\/statorials.org\/de"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/958"}],"collection":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/comments?post=958"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/958\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}