{"id":1320,"date":"2023-07-26T21:20:58","date_gmt":"2023-07-26T21:20:58","guid":{"rendered":"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/"},"modified":"2023-07-26T21:20:58","modified_gmt":"2023-07-26T21:20:58","slug":"variationskoeffizient-in-python","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/","title":{"rendered":"So berechnen sie den variationskoeffizienten in python"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Ein <strong>Variationskoeffizient<\/strong> , oft mit <em>CV<\/em> abgek\u00fcrzt, ist eine M\u00f6glichkeit, die Streuung von Werten in einem Datensatz relativ zum Mittelwert zu messen. Es wird wie folgt berechnet:<\/span><\/p>\n<p> <strong><span style=\"color: #000000;\">CV = \u03c3 \/ \u03bc<\/span><\/strong><\/p>\n<p> <span style=\"color: #000000;\">Gold:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>\u03c3:<\/strong> die Standardabweichung des Datensatzes<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u03bc:<\/strong> der Durchschnitt des Datensatzes<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Vereinfacht ausgedr\u00fcckt ist der Variationskoeffizient einfach das Verh\u00e4ltnis der Standardabweichung zum Mittelwert.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Wann ist der Variationskoeffizient zu verwenden?<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der Variationskoeffizient wird h\u00e4ufig verwendet, um die Variation zwischen zwei verschiedenen Datens\u00e4tzen zu vergleichen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In der realen Welt wird es im Finanzwesen h\u00e4ufig verwendet, um die durchschnittliche erwartete Rendite einer Investition mit der erwarteten Standardabweichung der Investition zu vergleichen. Dadurch k\u00f6nnen Anleger das Risiko-Rendite-Verh\u00e4ltnis zwischen Anlagen vergleichen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Angenommen, ein Anleger erw\u00e4gt eine Investition in die folgenden zwei Investmentfonds:<\/span><\/p>\n<p> <span style=\"color: #000000;\">Investmentfonds A: Mittelwert = 9 %, Standardabweichung = 12,4 %<\/span><\/p>\n<p> <span style=\"color: #000000;\">OGAW B: Durchschnitt = 5 %, Standardabweichung = 8,2 %<\/span><\/p>\n<p> <span style=\"color: #000000;\">Durch die Berechnung des Variationskoeffizienten jedes Fonds stellt der Anleger Folgendes fest:<\/span><\/p>\n<p> <span style=\"color: #000000;\">CV f\u00fcr Investmentfonds A = 12,4 % \/ 9 % = <strong>1,38<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">CV f\u00fcr Investmentfonds B = 8,2 % \/ 5 % = <strong>1,64<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Da Investmentfonds A einen niedrigeren Variationskoeffizienten aufweist, bietet er im Vergleich zur Standardabweichung eine bessere Durchschnittsrendite.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>So berechnen Sie den Variationskoeffizienten in Python<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Um den Variationskoeffizienten eines Datensatzes in Python zu berechnen, k\u00f6nnen Sie die folgende Syntax verwenden:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n\ncv = <span style=\"color: #008000;\">lambda<\/span> x: np. <span style=\"color: #3366ff;\">std<\/span> (x, ddof= <span style=\"color: #008000;\">1<\/span> ) \/ np. <span style=\"color: #3366ff;\">mean<\/span> (x) * <span style=\"color: #008000;\">100\n<\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Die folgenden Beispiele zeigen, wie Sie diese Syntax in der Praxis anwenden k\u00f6nnen.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Beispiel 1: Variationskoeffizient f\u00fcr ein einzelnes Netzwerk<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie der CV f\u00fcr eine einzelne Tabelle berechnet wird:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create vector of data\n<\/span>data = [88, 85, 82, 97, 67, 77, 74, 86, 81, 95, 77, 88, 85, 76, 81, 82]\n\n<span style=\"color: #008080;\">#define function to calculate cv<\/span>\ncv = <span style=\"color: #008000;\">lambda<\/span> x: np. <span style=\"color: #3366ff;\">std<\/span> (x, ddof= <span style=\"color: #008000;\">1<\/span> ) \/ np. <span style=\"color: #3366ff;\">mean<\/span> (x) * <span style=\"color: #008000;\">100 \n<\/span>\n<span style=\"color: #008080;\">#calculate CV\n<\/span>cv(data)\n\n9.234518\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Der Variationskoeffizient betr\u00e4gt <strong>9,23<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Beispiel 2: Variationskoeffizient f\u00fcr mehrere Vektoren<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie der CV mehrerer Spalten in einem Pandas DataFrame berechnet wird:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np<\/span>\n<span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#define function to calculate cv<\/span>\ncv = <span style=\"color: #008000;\">lambda<\/span> x: np. <span style=\"color: #3366ff;\">std<\/span> (x, ddof= <span style=\"color: #008000;\">1<\/span> ) \/ np. <span style=\"color: #3366ff;\">mean<\/span> (x) * <span style=\"color: #008000;\">100<\/span><\/span>\n\n#create pandas DataFrame\n<\/span>df = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({'a': [88, 85, 82, 97, 67, 77, 74, 86, 81, 95],\n                   'b': [77, 88, 85, 76, 81, 82, 88, 91, 92, 99],\n                   'c': [67, 68, 68, 74, 74, 76, 76, 77, 78, 84]})\n\n<span style=\"color: #008080;\">#calculate CV for each column in data frame\n<span style=\"color: #000000;\">df. <span style=\"color: #3366ff;\">apply<\/span> (cv)\n\na 11.012892\nb8.330843\nc7.154009\ndtype:float64<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Beachten Sie, dass fehlende Werte bei der Berechnung des Variationskoeffizienten einfach ignoriert werden:<\/span><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np<\/span>\n<span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n#define function to calculate cv\ncv = <span style=\"color: #008000;\">lambda<\/span> x: np. <span style=\"color: #3366ff;\">std<\/span> (x, ddof= <span style=\"color: #008000;\">1<\/span> ) \/ np. <span style=\"color: #3366ff;\">mean<\/span> (x) * <span style=\"color: #008000;\">100<\/span><\/span>\n\n#create pandas DataFrame\n<\/span>df = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({'a': [88, 85, 82, 97, 67, 77, 74, 86, 81, 95],\n                   'b': [77, 88, 85, 76, 81, 82, 88, 91, np. <span style=\"color: #3366ff;\">no<\/span> , 99],\n                   'c': [67, 68, 68, 74, 74, 76, 76, 77, 78, np. <span style=\"color: #3366ff;\">no<\/span> ]})\n\n<span style=\"color: #008080;\">#calculate CV for each column in data frame\n<span style=\"color: #000000;\">df. <span style=\"color: #3366ff;\">apply<\/span> (cv)\n\na 11.012892\nb 8.497612\nc5.860924\ndtype:float64<\/span><\/span><\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>Zus\u00e4tzliche Ressourcen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/de\/variationskoeffizient-von-r\/\" target=\"_blank\" rel=\"noopener\">So berechnen Sie den Variationskoeffizienten von R<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/variationskoeffizient-excel\/\" target=\"_blank\" rel=\"noopener\">So berechnen Sie den Variationskoeffizienten in Excel<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/variationskoeffizient-google-sheets\/\" target=\"_blank\" rel=\"noopener\">So berechnen Sie den Variationskoeffizienten in Google Sheets<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ein Variationskoeffizient , oft mit CV abgek\u00fcrzt, ist eine M\u00f6glichkeit, die Streuung von Werten in einem Datensatz relativ zum Mittelwert zu messen. Es wird wie folgt berechnet: CV = \u03c3 \/ \u03bc Gold: \u03c3: die Standardabweichung des Datensatzes \u03bc: der Durchschnitt des Datensatzes Vereinfacht ausgedr\u00fcckt ist der Variationskoeffizient einfach das Verh\u00e4ltnis der Standardabweichung zum Mittelwert. [&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 Variationskoeffizienten in Python - Statorials<\/title>\n<meta name=\"description\" content=\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie der Variationskoeffizient in Python berechnet wird.\" \/>\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\/variationskoeffizient-in-python\/\" \/>\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 Variationskoeffizienten in Python - Statorials\" \/>\n<meta property=\"og:description\" content=\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie der Variationskoeffizient in Python berechnet wird.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-26T21:20:58+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\/variationskoeffizient-in-python\/\",\"url\":\"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/\",\"name\":\"So berechnen Sie den Variationskoeffizienten in Python - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-26T21:20:58+00:00\",\"dateModified\":\"2023-07-26T21:20:58+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie der Variationskoeffizient in Python berechnet wird.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"So berechnen sie den variationskoeffizienten 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 Variationskoeffizienten in Python - Statorials","description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie der Variationskoeffizient in Python berechnet wird.","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\/variationskoeffizient-in-python\/","og_locale":"de_DE","og_type":"article","og_title":"So berechnen Sie den Variationskoeffizienten in Python - Statorials","og_description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie der Variationskoeffizient in Python berechnet wird.","og_url":"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/","og_site_name":"Statorials","article_published_time":"2023-07-26T21:20:58+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\/variationskoeffizient-in-python\/","url":"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/","name":"So berechnen Sie den Variationskoeffizienten in Python - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-26T21:20:58+00:00","dateModified":"2023-07-26T21:20:58+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie der Variationskoeffizient in Python berechnet wird.","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/variationskoeffizient-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"So berechnen sie den variationskoeffizienten 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\/1320"}],"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=1320"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1320\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=1320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=1320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}