{"id":4322,"date":"2023-07-12T00:55:26","date_gmt":"2023-07-12T00:55:26","guid":{"rendered":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/"},"modified":"2023-07-12T00:55:26","modified_gmt":"2023-07-12T00:55:26","slug":"pandas-beschrijven-alleen-gemiddelde-standaard","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/","title":{"rendered":"Panda&#39;s: hoe te beschrijven() gebruiken voor alleen mean en std"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt de functie <strong>beschrijven()<\/strong> gebruiken om <a href=\"https:\/\/statorials.org\/nl\/beschrijvende-inferentiele-statistiek\/\" target=\"_blank\" rel=\"noopener\">beschrijvende statistieken<\/a> te genereren voor variabelen in een pandas DataFrame.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Standaard berekent de functie <strong>beschrijven()<\/strong> de volgende statistieken voor elke numerieke variabele in een DataFrame:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">aantal (aantal waarden)<\/span><\/li>\n<li> <span style=\"color: #000000;\">gemiddeld (gemiddelde waarde)<\/span><\/li>\n<li> <span style=\"color: #000000;\">std (standaardafwijking)<\/span><\/li>\n<li> <span style=\"color: #000000;\">min (minimumwaarde)<\/span><\/li>\n<li> <span style=\"color: #000000;\">25% (25e percentiel)<\/span><\/li>\n<li> <span style=\"color: #000000;\">50% (50e percentiel)<\/span><\/li>\n<li> <span style=\"color: #000000;\">75% (75e percentiel)<\/span><\/li>\n<li> <span style=\"color: #000000;\">max (maximale waarde)<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">U kunt echter de volgende syntaxis gebruiken om alleen het gemiddelde en de standaardafwijking van elke numerieke variabele te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong>df. <span style=\"color: #3366ff;\">describe<\/span> (). <span style=\"color: #3366ff;\">loc<\/span> [[' <span style=\"color: #ff0000;\">mean<\/span> ', ' <span style=\"color: #ff0000;\">std<\/span> ']]\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Het volgende voorbeeld laat zien hoe u deze syntaxis in de praktijk kunt gebruiken.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld: Gebruik beschrijven() in Panda&#8217;s om alleen het gemiddelde en de standaard te berekenen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Stel dat we het volgende panda&#8217;s DataFrame hebben dat informatie bevat over verschillende basketbalspelers:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#createDataFrame\n<\/span>df = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({' <span style=\"color: #ff0000;\">team<\/span> ': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],\n                   ' <span style=\"color: #ff0000;\">points<\/span> ': [18, 22, 19, 14, 14, 11, 20, 28],\n                   ' <span style=\"color: #ff0000;\">assists<\/span> ': [5, 7, 7, 9, 12, 9, 9, 4],\n                   ' <span style=\"color: #ff0000;\">rebounds<\/span> ': [11, 8, 10, 6, 6, 5, 9, 12]})\n\n<span style=\"color: #008080;\">#view DataFrame\n<\/span><span style=\"color: #008000;\">print<\/span> (df)\n\n  team points assists rebounds\n0 A 18 5 11\n1 B 22 7 8\n2 C 19 7 10\n3 D 14 9 6\n4 E 14 12 6\n5 F 11 9 5\n6 G 20 9 9\n7:28 4 12\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Als we de functie <strong>beschrijven()<\/strong> gebruiken, kunnen we beschrijvende statistieken berekenen voor elke numerieke variabele in het DataFrame:<\/span><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#calculate descriptive statistics for each numeric variable\n<span style=\"color: #000000;\">df. <span style=\"color: #3366ff;\">describe<\/span> ()\n<\/span>\n<\/span>points assists rebounds\ncount 8.000000 8.00000 8.000000\nmean 18.250000 7.75000 8.375000\nstd 5.365232 2.54951 2.559994\nmin 11.000000 4.00000 5.000000\n25% 14,000000 6,50000 6,000000\n50% 18.500000 8.00000 8.500000\n75% 20.500000 9.00000 10.250000\nmax 28.000000 12.00000 12.000000<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We kunnen echter de volgende syntaxis gebruiken om alleen het <a href=\"https:\/\/statorials.org\/nl\/belang-van-het-gemiddelde\/\" target=\"_blank\" rel=\"noopener\">gemiddelde<\/a> en <a href=\"https:\/\/statorials.org\/nl\/waarom-is-de-standaarddeviatie-belangrijk\/\" target=\"_blank\" rel=\"noopener\">de standaardafwijking<\/a> van elke numerieke variabele te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#only calculate mean and standard deviation of each numeric variable<\/span>\ndf. <span style=\"color: #3366ff;\">describe<\/span> (). <span style=\"color: #3366ff;\">loc<\/span> [[' <span style=\"color: #ff0000;\">mean<\/span> ', ' <span style=\"color: #ff0000;\">std<\/span> ']]\n\n           points assists rebounds\nmean 18.250000 7.75000 8.375000\nstd 5.365232 2.54951 2.559994\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Houd er rekening mee dat de uitvoer alleen het gemiddelde en de standaardafwijking voor elke numerieke variabele bevat.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Merk op dat de functie <strong>beschrijven()<\/strong> nog steeds elke beschrijvende statistiek berekende zoals voorheen, maar we gebruikten de functie <strong>loc<\/strong> om alleen de rijen met de naam <strong>mean<\/strong> en <strong>std<\/strong> in de uitvoer te selecteren.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Gerelateerd:<\/strong> <a href=\"https:\/\/statorials.org\/nl\/pandas-loc-versus-iloc\/\" target=\"_blank\" rel=\"noopener\">Panda&#8217;s loc versus iloc: wat is het verschil?<\/a><\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere veelvoorkomende bewerkingen in panda&#8217;s kunt uitvoeren:<\/span><\/p>\n<p><a href=\"https:\/\/statorials.org\/nl\/pandas-groepsgewijs-beschrijven\/\" target=\"_blank\" rel=\"noopener\">Panda&#8217;s: beschrijven() gebruiken per groep<\/a><br \/><a href=\"https:\/\/statorials.org\/nl\/pandas-beschrijven-percentielen\/\" target=\"_blank\" rel=\"noopener\">Panda&#8217;s: beschrijven() gebruiken met specifieke percentielen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/pandas-beschrijven-geen-wetenschappelijke-notatie\/\" target=\"_blank\" rel=\"noopener\">Panda&#8217;s: beschrijven() gebruiken en wetenschappelijke notatie verwijderen<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt de functie beschrijven() gebruiken om beschrijvende statistieken te genereren voor variabelen in een pandas DataFrame. Standaard berekent de functie beschrijven() de volgende statistieken voor elke numerieke variabele in een DataFrame: aantal (aantal waarden) gemiddeld (gemiddelde waarde) std (standaardafwijking) min (minimumwaarde) 25% (25e percentiel) 50% (50e percentiel) 75% (75e percentiel) max (maximale waarde) U [&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-4322","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Panda&#039;s: Hoe te beschrijven() gebruiken voor alleen Mean en Std \u2013 Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u de functie beschrijven() in panda&#039;s kunt gebruiken om alleen het gemiddelde en de standaarddeviatie van variabelen te berekenen.\" \/>\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\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Panda&#039;s: Hoe te beschrijven() gebruiken voor alleen Mean en Std \u2013 Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u de functie beschrijven() in panda&#039;s kunt gebruiken om alleen het gemiddelde en de standaarddeviatie van variabelen te berekenen.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-12T00:55:26+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\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/\",\"url\":\"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/\",\"name\":\"Panda&#39;s: Hoe te beschrijven() gebruiken voor alleen Mean en Std \u2013 Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-12T00:55:26+00:00\",\"dateModified\":\"2023-07-12T00:55:26+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u de functie beschrijven() in panda&#39;s kunt gebruiken om alleen het gemiddelde en de standaarddeviatie van variabelen te berekenen.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Panda&#39;s: hoe te beschrijven() gebruiken voor alleen mean en std\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Panda&#39;s: Hoe te beschrijven() gebruiken voor alleen Mean en Std \u2013 Statorials","description":"In deze tutorial wordt uitgelegd hoe u de functie beschrijven() in panda&#39;s kunt gebruiken om alleen het gemiddelde en de standaarddeviatie van variabelen te berekenen.","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\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/","og_locale":"de_DE","og_type":"article","og_title":"Panda&#39;s: Hoe te beschrijven() gebruiken voor alleen Mean en Std \u2013 Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u de functie beschrijven() in panda&#39;s kunt gebruiken om alleen het gemiddelde en de standaarddeviatie van variabelen te berekenen.","og_url":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/","og_site_name":"Statorials","article_published_time":"2023-07-12T00:55:26+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/","url":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/","name":"Panda&#39;s: Hoe te beschrijven() gebruiken voor alleen Mean en Std \u2013 Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-12T00:55:26+00:00","dateModified":"2023-07-12T00:55:26+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u de functie beschrijven() in panda&#39;s kunt gebruiken om alleen het gemiddelde en de standaarddeviatie van variabelen te berekenen.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/pandas-beschrijven-alleen-gemiddelde-standaard\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Panda&#39;s: hoe te beschrijven() gebruiken voor alleen mean en std"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/4322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=4322"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/4322\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=4322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=4322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=4322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}