{"id":3608,"date":"2023-07-16T13:48:44","date_gmt":"2023-07-16T13:48:44","guid":{"rendered":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/"},"modified":"2023-07-16T13:48:44","modified_gmt":"2023-07-16T13:48:44","slug":"histogram-serii-pand","status":"publish","type":"post","link":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/","title":{"rendered":"Jak utworzy\u0107 histogram z serii pandy"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Aby utworzy\u0107 histogram z serii pand, mo\u017cesz u\u017cy\u0107 nast\u0119puj\u0105cej podstawowej sk\u0142adni:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>my_series. <span style=\"color: #3366ff;\">plot<\/span> (kind=' <span style=\"color: #ff0000;\">hist<\/span> ')\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Poni\u017csze przyk\u0142ady pokazuj\u0105, jak u\u017cywa\u0107 tej sk\u0142adni w praktyce.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Uwaga<\/strong> : Je\u015bli u\u017cywasz internetowego notesu w j\u0119zyku Python i nie widzisz histogramu po u\u017cyciu tej sk\u0142adni, konieczne mo\u017ce by\u0107 najpierw okre\u015blenie <a href=\"https:\/\/statorials.org\/pl\/matplotlib-w-internecie\/\" target=\"_blank\" rel=\"noopener\">%matplotlib online<\/a> .<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Przyk\u0142ad 1: Utw\u00f3rz histogram cz\u0119stotliwo\u015bci<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Poni\u017cszy kod pokazuje, jak utworzy\u0107 histogram cz\u0119stotliwo\u015bci na podstawie serii pand:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#createSeries\n<\/span>data = pd. <span style=\"color: #3366ff;\">Series<\/span> ([2, 2, 2, 3, 3, 4, 5, 7, 8, 9, 12, 12, 14, 15, 16, 16, 18,\n                    19, 22, 22, 22, 25, 26, 27, 30, 33, 33, 33, 34, 35])\n\n<span style=\"color: #008080;\">#create histogram from Series\n<\/span>data. <span style=\"color: #3366ff;\">plot<\/span> (kind=' <span style=\"color: #ff0000;\">hist<\/span> ')\n<\/span><\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-29721 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/histseries1.jpg\" alt=\"\" width=\"504\" height=\"379\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">O\u015b x wy\u015bwietla warto\u015bci serii pand, podczas gdy o\u015b y wy\u015bwietla cz\u0119stotliwo\u015b\u0107 ka\u017cdej warto\u015bci.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Przyk\u0142ad 2: Utw\u00f3rz histogram g\u0119sto\u015bci<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Aby utworzy\u0107 histogram g\u0119sto\u015bci na podstawie serii pand, mo\u017cemy okre\u015bli\u0107 <strong>g\u0119sto\u015b\u0107=True<\/strong> w funkcji <strong>plot()<\/strong> :<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#createSeries\n<\/span>data = pd. <span style=\"color: #3366ff;\">Series<\/span> ([2, 2, 2, 3, 3, 4, 5, 7, 8, 9, 12, 12, 14, 15, 16, 16, 18,\n                    19, 22, 22, 22, 25, 26, 27, 30, 33, 33, 33, 34, 35])\n\n<span style=\"color: #008080;\">#create histogram from Series\n<\/span>data. <span style=\"color: #3366ff;\">plot<\/span> (kind=' <span style=\"color: #ff0000;\">hist<\/span> ', density= <span style=\"color: #008000;\">True<\/span> )<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-29722 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/histseries2.jpg\" alt=\"\" width=\"503\" height=\"358\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">O\u015b x wy\u015bwietla warto\u015bci serii pand, a o\u015b y wy\u015bwietla g\u0119sto\u015b\u0107.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Przyk\u0142ad 3: Utw\u00f3rz niestandardowy histogram<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Na koniec mo\u017cemy u\u017cy\u0107 nast\u0119puj\u0105cej sk\u0142adni, aby dostosowa\u0107 kolor s\u0142upk\u00f3w histogramu, liczb\u0119 u\u017cywanych pojemnik\u00f3w, etykiety osi i tytu\u0142 wykresu:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#createSeries\n<\/span>data = pd. <span style=\"color: #3366ff;\">Series<\/span> ([2, 2, 2, 3, 3, 4, 5, 7, 8, 9, 12, 12, 14, 15, 16, 16, 18,\n                    19, 22, 22, 22, 25, 26, 27, 30, 33, 33, 33, 34, 35])\n\n<span style=\"color: #008080;\">#create histogram with custom color, edgecolor, and number of bins\n<\/span>my_hist = data. <span style=\"color: #3366ff;\">plot<\/span> (kind=' <span style=\"color: #ff0000;\">hist<\/span> ', color=' <span style=\"color: #ff0000;\">red<\/span> ', edgecolor=' <span style=\"color: #ff0000;\">black<\/span> ', bins= <span style=\"color: #008000;\">20<\/span> )\n\n<span style=\"color: #008080;\">#add x-axis label\n<\/span>my_hist. <span style=\"color: #3366ff;\">set_xlabel<\/span> (' <span style=\"color: #ff0000;\">Values<\/span> ')\n\n<span style=\"color: #008080;\">#add title\n<\/span>my_hist. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Distribution of Values<\/span> ')<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-29723 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/histseries3.jpg\" alt=\"\" width=\"518\" height=\"414\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Dodatkowe zasoby<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Poni\u017csze samouczki wyja\u015bniaj\u0105, jak tworzy\u0107 inne popularne w\u0105tki w Pythonie:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/pl\/wykresl-wiele-linii-matplotlib\/\" target=\"_blank\" rel=\"noopener\">Jak wykre\u015bli\u0107 wiele linii w Matplotlib<\/a><br \/> <a href=\"https:\/\/statorials.org\/pl\/pandy-w-pude\u0142ku\/\" target=\"_blank\" rel=\"noopener\">Jak utworzy\u0107 wykres pude\u0142kowy z Pandas DataFrame<\/a><br \/> <a href=\"https:\/\/statorials.org\/pl\/wykres-wielokolumnowy-pand\/\" target=\"_blank\" rel=\"noopener\">Jak wykre\u015bli\u0107 wiele kolumn Pand na wykresie s\u0142upkowym<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aby utworzy\u0107 histogram z serii pand, mo\u017cesz u\u017cy\u0107 nast\u0119puj\u0105cej podstawowej sk\u0142adni: my_series. plot (kind=&#8217; hist &#8217;) Poni\u017csze przyk\u0142ady pokazuj\u0105, jak u\u017cywa\u0107 tej sk\u0142adni w praktyce. Uwaga : Je\u015bli u\u017cywasz internetowego notesu w j\u0119zyku Python i nie widzisz histogramu po u\u017cyciu tej sk\u0142adni, konieczne mo\u017ce by\u0107 najpierw okre\u015blenie %matplotlib online . Przyk\u0142ad 1: Utw\u00f3rz histogram cz\u0119stotliwo\u015bci [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-3608","post","type-post","status-publish","format-standard","hentry","category-przewodnik"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jak utworzy\u0107 histogram z serii Pandy - Statorials<\/title>\n<meta name=\"description\" content=\"W tym samouczku wyja\u015bniono, jak utworzy\u0107 histogram z serii pand, podaj\u0105c kilka przyk\u0142ad\u00f3w.\" \/>\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\/pl\/histogram-serii-pand\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jak utworzy\u0107 histogram z serii Pandy - Statorials\" \/>\n<meta property=\"og:description\" content=\"W tym samouczku wyja\u015bniono, jak utworzy\u0107 histogram z serii pand, podaj\u0105c kilka przyk\u0142ad\u00f3w.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/pl\/histogram-serii-pand\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-16T13:48:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/histseries1.jpg\" \/>\n<meta name=\"author\" content=\"Benjamin Anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Napisane przez\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Szacowany czas czytania\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/pl\/histogram-serii-pand\/\",\"url\":\"https:\/\/statorials.org\/pl\/histogram-serii-pand\/\",\"name\":\"Jak utworzy\u0107 histogram z serii Pandy - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/pl\/#website\"},\"datePublished\":\"2023-07-16T13:48:44+00:00\",\"dateModified\":\"2023-07-16T13:48:44+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/pl\/#\/schema\/person\/6484727a4612df3e69f016c3129c6965\"},\"description\":\"W tym samouczku wyja\u015bniono, jak utworzy\u0107 histogram z serii pand, podaj\u0105c kilka przyk\u0142ad\u00f3w.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/pl\/histogram-serii-pand\/#breadcrumb\"},\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/pl\/histogram-serii-pand\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/pl\/histogram-serii-pand\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Dom\",\"item\":\"https:\/\/statorials.org\/pl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Jak utworzy\u0107 histogram z serii pandy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/pl\/#website\",\"url\":\"https:\/\/statorials.org\/pl\/\",\"name\":\"Statorials\",\"description\":\"Tw\u00f3j przewodnik po kompetencjach statystycznych!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/pl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pl-PL\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/pl\/#\/schema\/person\/6484727a4612df3e69f016c3129c6965\",\"name\":\"Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/statorials.org\/pl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/pl\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/pl\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Benjamin Anderson\"},\"description\":\"Cze\u015b\u0107, jestem Benjamin i jestem emerytowanym profesorem statystyki, kt\u00f3ry zosta\u0142 oddanym nauczycielem Statorials. Dzi\u0119ki bogatemu do\u015bwiadczeniu i wiedzy specjalistycznej w dziedzinie statystyki ch\u0119tnie dziel\u0119 si\u0119 swoj\u0105 wiedz\u0105, aby wzmocni\u0107 pozycj\u0119 uczni\u00f3w za po\u015brednictwem Statorials. Wiedzie\u0107 wi\u0119cej\",\"sameAs\":[\"https:\/\/statorials.org\/pl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Jak utworzy\u0107 histogram z serii Pandy - Statorials","description":"W tym samouczku wyja\u015bniono, jak utworzy\u0107 histogram z serii pand, podaj\u0105c kilka przyk\u0142ad\u00f3w.","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\/pl\/histogram-serii-pand\/","og_locale":"pl_PL","og_type":"article","og_title":"Jak utworzy\u0107 histogram z serii Pandy - Statorials","og_description":"W tym samouczku wyja\u015bniono, jak utworzy\u0107 histogram z serii pand, podaj\u0105c kilka przyk\u0142ad\u00f3w.","og_url":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/","og_site_name":"Statorials","article_published_time":"2023-07-16T13:48:44+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/histseries1.jpg"}],"author":"Benjamin Anderson","twitter_card":"summary_large_image","twitter_misc":{"Napisane przez":"Benjamin Anderson","Szacowany czas czytania":"2 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/","url":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/","name":"Jak utworzy\u0107 histogram z serii Pandy - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/pl\/#website"},"datePublished":"2023-07-16T13:48:44+00:00","dateModified":"2023-07-16T13:48:44+00:00","author":{"@id":"https:\/\/statorials.org\/pl\/#\/schema\/person\/6484727a4612df3e69f016c3129c6965"},"description":"W tym samouczku wyja\u015bniono, jak utworzy\u0107 histogram z serii pand, podaj\u0105c kilka przyk\u0142ad\u00f3w.","breadcrumb":{"@id":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/pl\/histogram-serii-pand\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/pl\/histogram-serii-pand\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Dom","item":"https:\/\/statorials.org\/pl\/"},{"@type":"ListItem","position":2,"name":"Jak utworzy\u0107 histogram z serii pandy"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/pl\/#website","url":"https:\/\/statorials.org\/pl\/","name":"Statorials","description":"Tw\u00f3j przewodnik po kompetencjach statystycznych!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/pl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pl-PL"},{"@type":"Person","@id":"https:\/\/statorials.org\/pl\/#\/schema\/person\/6484727a4612df3e69f016c3129c6965","name":"Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/statorials.org\/pl\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/pl\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/pl\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Benjamin Anderson"},"description":"Cze\u015b\u0107, jestem Benjamin i jestem emerytowanym profesorem statystyki, kt\u00f3ry zosta\u0142 oddanym nauczycielem Statorials. Dzi\u0119ki bogatemu do\u015bwiadczeniu i wiedzy specjalistycznej w dziedzinie statystyki ch\u0119tnie dziel\u0119 si\u0119 swoj\u0105 wiedz\u0105, aby wzmocni\u0107 pozycj\u0119 uczni\u00f3w za po\u015brednictwem Statorials. Wiedzie\u0107 wi\u0119cej","sameAs":["https:\/\/statorials.org\/pl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/posts\/3608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/comments?post=3608"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/posts\/3608\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/media?parent=3608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/categories?post=3608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/pl\/wp-json\/wp\/v2\/tags?post=3608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}