{"id":2207,"date":"2023-07-23T06:30:13","date_gmt":"2023-07-23T06:30:13","guid":{"rendered":"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/"},"modified":"2023-07-23T06:30:13","modified_gmt":"2023-07-23T06:30:13","slug":"true_divideda-gecersiz-degerle-karsilasildi","status":"publish","type":"post","link":"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/","title":{"rendered":"Nas\u0131l d\u00fczeltilir? true_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">NumPy&#8217;yi kullan\u0131rken kar\u015f\u0131la\u015fabilece\u011finiz bir uyar\u0131:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #ff0000;\">RuntimeWarning<\/span> : invalid value encountered in true_divide<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Bu uyar\u0131, bir NumPy dizisinde ge\u00e7ersiz bir de\u011fere (NaN, Inf vb.) b\u00f6lmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131zda ortaya \u00e7\u0131kar.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Bunun yaln\u0131zca bir <strong>uyar\u0131<\/strong> oldu\u011funu ve NumPy&#8217;nin ge\u00e7ersiz bir de\u011fere b\u00f6lmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131nda basit\u00e7e bir nan de\u011feri d\u00f6nd\u00fcrece\u011fini unutmamak gerekir.<\/span><\/p>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki \u00f6rnekte bu uyar\u0131ya pratikte nas\u0131l yan\u0131t verilece\u011fi g\u00f6sterilmektedir.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Hata nas\u0131l yeniden olu\u015fturulur?<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Bir NumPy dizisinin de\u011ferlerini ba\u015fka bir NumPy dizisinin de\u011ferlerine b\u00f6lmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131m\u0131z\u0131 varsayal\u0131m:<\/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\n<span style=\"color: #008080;\">#define NumPy arrays\n<span style=\"color: #000000;\">x = np. <span style=\"color: #3366ff;\">array<\/span> ([4, 5, 5, 7, 0])\ny = np. <span style=\"color: #3366ff;\">array<\/span> ([2, 4, 6, 7, 0])\n\n<span style=\"color: #008080;\">#divide the values in <em>x<\/em> by the values in <em>y<\/em>\n<\/span>n.p. <span style=\"color: #3366ff;\">divide<\/span> (x,y)\n\narray([2., 1.25, 0.8333, 1., no])\n\n<span style=\"color: #ff0000;\">RuntimeWarning<\/span> : invalid value encountered in true_divide\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">NumPy&#8217;nin her x de\u011ferini kar\u015f\u0131l\u0131k gelen y de\u011ferine b\u00f6ld\u00fc\u011f\u00fcn\u00fc ancak bir <strong>RuntimeWarning<\/strong> \u00fcretildi\u011fini unutmay\u0131n.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Bunun nedeni, ger\u00e7ekle\u015ftirilen son b\u00f6lme i\u015fleminin s\u0131f\u0131r b\u00f6l\u00fc s\u0131f\u0131r olmas\u0131 ve bunun da <strong>nan<\/strong> de\u011feriyle sonu\u00e7lanmas\u0131d\u0131r.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Bu uyar\u0131ya nas\u0131l yan\u0131t verilir?<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Daha \u00f6nce de belirtildi\u011fi gibi, bu RuntimeWarning yaln\u0131zca bir <strong>uyar\u0131d\u0131r<\/strong> ve kodun y\u00fcr\u00fct\u00fclmesini engellemez.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">Ancak bu t\u00fcr uyar\u0131lar\u0131 gizlemek istiyorsan\u0131z a\u015fa\u011f\u0131daki s\u00f6zdizimini kullanabilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\">n.p. <span style=\"color: #3366ff;\">seterr<\/span> (invalid=' <span style=\"color: #ff0000;\">ignore<\/span> ')<\/span>\n<\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Bu, NumPy&#8217;ye &#8220;ge\u00e7ersiz&#8221; mesaj i\u00e7eren uyar\u0131lar\u0131 gizlemesini s\u00f6yler.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Yani kodu tekrar \u00e7al\u0131\u015ft\u0131r\u0131rsak herhangi bir uyar\u0131 almayaca\u011f\u0131z:<\/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\n<span style=\"color: #008080;\">#define NumPy arrays\n<span style=\"color: #000000;\">x = np. <span style=\"color: #3366ff;\">array<\/span> ([4, 5, 5, 7, 0])\ny = np. <span style=\"color: #3366ff;\">array<\/span> ([2, 4, 6, 7, 0])\n\n<span style=\"color: #008080;\">#divide the values in <em>x<\/em> by the values in <em>y<\/em>\n<\/span>n.p. <span style=\"color: #3366ff;\">divide<\/span> (x,y)\n\narray([2., 1.25, 0.8333, 1., no])<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u00c7\u0131k\u0131\u015f\u0131n son de\u011feri i\u00e7in yine bir <strong>nan<\/strong> de\u011feri d\u00f6nd\u00fcr\u00fcl\u00fcr ancak bu sefer herhangi bir uyar\u0131 mesaj\u0131 g\u00f6r\u00fcnt\u00fclenmez.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Ek kaynaklar<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki e\u011fitimlerde Python&#8217;daki di\u011fer yayg\u0131n hatalar\u0131n nas\u0131l d\u00fczeltilece\u011fi a\u00e7\u0131klanmaktad\u0131r:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/tr\/pandalarin-anahtar-hatasi\/\" target=\"_blank\" rel=\"noopener\">Pandas&#8217;ta KeyError Nas\u0131l D\u00fczeltilir<\/a><br \/> <a href=\"https:\/\/statorials.org\/tr\/deger-hatasi-kayan-noktali-nani-tam-sayiya-donusturemiyor\/\" target=\"_blank\" rel=\"noopener\">Nas\u0131l d\u00fczeltilir? ValueError: float NaN int&#8217;ye d\u00f6n\u00fc\u015ft\u00fcr\u00fclemiyor<\/a><br \/> <a href=\"https:\/\/statorials.org\/tr\/islenenler-formlarla-yayinlanamadi\/\" target=\"_blank\" rel=\"noopener\">Nas\u0131l d\u00fczeltilir? ValueError: \u0130\u015flenenler \u015fekillerle yay\u0131nlanamad\u0131<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>NumPy&#8217;yi kullan\u0131rken kar\u015f\u0131la\u015fabilece\u011finiz bir uyar\u0131: RuntimeWarning : invalid value encountered in true_divide Bu uyar\u0131, bir NumPy dizisinde ge\u00e7ersiz bir de\u011fere (NaN, Inf vb.) b\u00f6lmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131zda ortaya \u00e7\u0131kar. Bunun yaln\u0131zca bir uyar\u0131 oldu\u011funu ve NumPy&#8217;nin ge\u00e7ersiz bir de\u011fere b\u00f6lmeye \u00e7al\u0131\u015ft\u0131\u011f\u0131nda basit\u00e7e bir nan de\u011feri d\u00f6nd\u00fcrece\u011fini unutmamak gerekir. A\u015fa\u011f\u0131daki \u00f6rnekte bu uyar\u0131ya pratikte nas\u0131l yan\u0131t verilece\u011fi g\u00f6sterilmektedir. [&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-2207","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>Nas\u0131l d\u00fczeltilir? True_divide&#039;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131 - Statorials<\/title>\n<meta name=\"description\" content=\"Bu e\u011fitimde Python&#039;da a\u015fa\u011f\u0131daki uyar\u0131 iletisinin nas\u0131l ele al\u0131naca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r: RuntimeWarning: True_divide&#039;da kar\u015f\u0131la\u015f\u0131lan ge\u00e7ersiz de\u011fer.\" \/>\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\/true_divideda-gecersiz-degerle-karsilasildi\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nas\u0131l d\u00fczeltilir? True_divide&#039;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131 - Statorials\" \/>\n<meta property=\"og:description\" content=\"Bu e\u011fitimde Python&#039;da a\u015fa\u011f\u0131daki uyar\u0131 iletisinin nas\u0131l ele al\u0131naca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r: RuntimeWarning: True_divide&#039;da kar\u015f\u0131la\u015f\u0131lan ge\u00e7ersiz de\u011fer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-23T06:30:13+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\/true_divideda-gecersiz-degerle-karsilasildi\/\",\"url\":\"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/\",\"name\":\"Nas\u0131l d\u00fczeltilir? True_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131 - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/tr\/#website\"},\"datePublished\":\"2023-07-23T06:30:13+00:00\",\"dateModified\":\"2023-07-23T06:30:13+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\"},\"description\":\"Bu e\u011fitimde Python&#39;da a\u015fa\u011f\u0131daki uyar\u0131 iletisinin nas\u0131l ele al\u0131naca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r: RuntimeWarning: True_divide&#39;da kar\u015f\u0131la\u015f\u0131lan ge\u00e7ersiz de\u011fer.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ev\",\"item\":\"https:\/\/statorials.org\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Nas\u0131l d\u00fczeltilir? true_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131\"}]},{\"@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":"Nas\u0131l d\u00fczeltilir? True_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131 - Statorials","description":"Bu e\u011fitimde Python&#39;da a\u015fa\u011f\u0131daki uyar\u0131 iletisinin nas\u0131l ele al\u0131naca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r: RuntimeWarning: True_divide&#39;da kar\u015f\u0131la\u015f\u0131lan ge\u00e7ersiz de\u011fer.","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\/true_divideda-gecersiz-degerle-karsilasildi\/","og_locale":"tr_TR","og_type":"article","og_title":"Nas\u0131l d\u00fczeltilir? True_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131 - Statorials","og_description":"Bu e\u011fitimde Python&#39;da a\u015fa\u011f\u0131daki uyar\u0131 iletisinin nas\u0131l ele al\u0131naca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r: RuntimeWarning: True_divide&#39;da kar\u015f\u0131la\u015f\u0131lan ge\u00e7ersiz de\u011fer.","og_url":"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/","og_site_name":"Statorials","article_published_time":"2023-07-23T06:30:13+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\/true_divideda-gecersiz-degerle-karsilasildi\/","url":"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/","name":"Nas\u0131l d\u00fczeltilir? True_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131 - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/tr\/#website"},"datePublished":"2023-07-23T06:30:13+00:00","dateModified":"2023-07-23T06:30:13+00:00","author":{"@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48"},"description":"Bu e\u011fitimde Python&#39;da a\u015fa\u011f\u0131daki uyar\u0131 iletisinin nas\u0131l ele al\u0131naca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r: RuntimeWarning: True_divide&#39;da kar\u015f\u0131la\u015f\u0131lan ge\u00e7ersiz de\u011fer.","breadcrumb":{"@id":"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/tr\/true_divideda-gecersiz-degerle-karsilasildi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ev","item":"https:\/\/statorials.org\/tr\/"},{"@type":"ListItem","position":2,"name":"Nas\u0131l d\u00fczeltilir? true_divide&#39;da ge\u00e7ersiz de\u011ferle kar\u015f\u0131la\u015f\u0131ld\u0131"}]},{"@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\/2207","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=2207"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/2207\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/media?parent=2207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/categories?post=2207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/tags?post=2207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}