{"id":14310,"date":"2021-07-07T08:18:50","date_gmt":"2021-07-07T02:48:50","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=14310"},"modified":"2023-05-07T14:28:21","modified_gmt":"2023-05-07T08:58:21","slug":"python-remove-nan-from-list","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/","title":{"rendered":"5 Easy Ways in Python to Remove Nan from List"},"content":{"rendered":"\n<p>In Python,<strong><em> <\/em>NaN<em> <\/em>stands for Not a Number<\/strong>. It is used to represent values that are not present in a dataset or file. It is categorized as a special floating-point value and can only be converted to a float data type. Dealing with NaN type is necessary while working on datasets. There are several ways and built-in functions in Python to remove NaN values. In this article, we shall be looking into such ways in Python to remove nan from the <em>list<\/em>. <\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#Why_should_we_remove_NaN_values\" >Why should we remove NaN values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#Why_cannot_we_use_npnan_npnan\" >Why cannot we use np.nan == np.nan?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#Ways_to_remove_nan_from_the_list\" >Ways to remove nan from the list<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#1_Python_Remove_nan_from_List_Using_Numpys_isnan_function\" >1. Python Remove nan from List Using Numpy&#8217;s isnan() function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#The_entire_code_is\" >The entire code is:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#2_By_using_Maths_isnan_function\" >2. By using Math&#8217;s isnan() function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#The_Entire_Code_is\" >The Entire Code is:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#3_Python_Remove_nan_from_List_Using_Pandas_isnull_function\" >3. Python Remove nan from List Using Pandas isnull() function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#The_Entire_Code_is-2\" >The Entire Code is:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#4_Python_Remove_nan_from_List_Using_for_loop\" >4. Python Remove nan from List Using for loop<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#The_entire_code_is-2\" >The entire code is:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#5_With_list_comprehension\" >5. With list comprehension<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#The_syntax_of_list_comprehension_is\" >The syntax of list comprehension is:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#Popular_Right_Now\" >Popular Right Now<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-why-should-we-remove-nan-values\"><span class=\"ez-toc-section\" id=\"Why_should_we_remove_NaN_values\"><\/span>Why should we remove NaN values?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>While performing data analysis, it is important to remove the NaN values. NaN basically represents data that either does not exist or was not collected. Because of missing data, it might mislead the model. It might affect the accuracy and predictions of the model. Hence, it is important to remove nan values.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-cannot-we-use-np-nan-np-nan\"><span class=\"ez-toc-section\" id=\"Why_cannot_we_use_npnan_npnan\"><\/span>Why cannot we use np.nan == np.nan?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When we perform np.nan == np.nan in Python, the output is False as they are not equal. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\nprint(np.nan == np.nan)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">False<\/pre>\n\n\n\n<p>The reason behind it is that Python does not consider an equivalence relation between two NaN values. Since NaN values are not defined, two NaN values are not equal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-ways-to-remove-nan-from-the-list\"><span class=\"ez-toc-section\" id=\"Ways_to_remove_nan_from_the_list\"><\/span>Ways to remove nan from the list<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Let us now look at 5 easy and effective ways in Python of removing nan values from a list. <\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Using Numpy&#8217;s isnan() function<\/strong><\/li>\n\n\n\n<li><strong>By using Math&#8217;s isnan() function<\/strong><\/li>\n\n\n\n<li><strong>Using Pandas isnull() function<\/strong><\/li>\n\n\n\n<li><strong>Using for loop<\/strong><\/li>\n\n\n\n<li><strong>With list comprehension<\/strong><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-python-remove-nan-from-list-using-numpy-s-isnan-function\"><span class=\"ez-toc-section\" id=\"1_Python_Remove_nan_from_List_Using_Numpys_isnan_function\"><\/span>1. Python Remove nan from List Using Numpy&#8217;s isnan() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The <em>isnan()<\/em> function in numpy will check in a numpy array if the element is NaN or not. It returns a numpy array as an output that contains boolean values. The value will be False where the item is not NaN and True where it is NaN.<\/p>\n\n\n\n<p>For that, first, we will have to import the numpy library. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\nfrom numpy import nan\n<\/pre><\/div>\n\n\n<p>Using <em>np.array()<\/em>, we shall create a numpy array containing three integer values and three NaN values.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nmy_array = np.array(&#x5B;10, 25, nan, 15,nan,nan]\n<\/pre><\/div>\n\n\n<p>Then, we shall wrap the <em>np.logical_not() <\/em>function around the output of the<em> isnan() <\/em>function. We do that because we want the non-NaN values to be printed into the new array. By using logical_not(), it will convert the False values into True and vice &#8211; versa. So, for non-NaN values, the value will be True, and for NaN values, it will be false. We shall save the new array into the <em>&#8216;new_array&#8217;<\/em> variable.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nnew_array = my_array&#x5B;np.logical_not(np.isnan(my_array))]\nprint(new_array)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[10. 25. 15.]<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-entire-code-is\"><span class=\"ez-toc-section\" id=\"The_entire_code_is\"><\/span>The entire code is:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\nfrom numpy import nan\nmy_array = np.array(&#x5B;10, 25, nan, 15,nan,nan])\n\nnew_array = my_array&#x5B;np.logical_not(np.isnan(my_array))]\nprint(new_array)\n<\/pre><\/div>\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-golf monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\" style=\"font-size:18px;\" href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\">[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-by-using-math-s-isnan-function\"><span class=\"ez-toc-section\" id=\"2_By_using_Maths_isnan_function\"><\/span>2. By using Math&#8217;s isnan() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Like numpy, python&#8217;s math library also has<em> isnan() <\/em>function. It will return a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Boolean\" target=\"_blank\" rel=\"noreferrer noopener\">boolean<\/a> value &#8211; True if the number is NaN and False if it is not NaN.<\/p>\n\n\n\n<p>To use math&#8217;s <em>isnan()<\/em> function, we will first have to import the math library. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport math\nfrom numpy import nan\n<\/pre><\/div>\n\n\n<p>Then, we shall create a list containing integer values and NaN.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nmy_list = &#x5B;10, 25, nan, 15,nan,nan]\n<\/pre><\/div>\n\n\n<p>The <em>isnan()<\/em> in the math library will check for one individual number at a time. So, we shall use list comprehension here to <a href=\"http:\/\/www.pythonpool.com\/python-iterate-through-list\/\" target=\"_blank\" rel=\"noreferrer noopener\">iterate over one item<\/a> and save the new list into<em> &#8216;new_list&#8217;.<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nnew_list = &#x5B;item for item in my_list if not(math.isnan(item)) == True]\n\nprint(new_list)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[10, 25, 15]<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-entire-code-is-1\"><span class=\"ez-toc-section\" id=\"The_Entire_Code_is\"><\/span>The Entire Code is:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport math\nfrom numpy import nan\nmy_list = &#x5B;10, 25, nan, 15,nan,nan]\nnew_list = &#x5B;item for item in my_list if not(math.isnan(item)) == True]\nprint(new_list)\n<\/pre><\/div>\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-kilo monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\" style=\"font-size:19px;\" href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\">[Fixed] nameerror: name Unicode is not defined<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-python-remove-nan-from-list-using-pandas-isnull-function\"><span class=\"ez-toc-section\" id=\"3_Python_Remove_nan_from_List_Using_Pandas_isnull_function\"><\/span>3. Python Remove nan from List Using Pandas isnull() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The pandas library in python has a function named <em>isnull() <\/em>which can be used in python to remove NaN values from the list. <\/p>\n\n\n\n<p>First, we will import the pandas library.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pandas as pd\nfrom numpy import nan\n<\/pre><\/div>\n\n\n<p>Then we shall use list comprehension here and run a for loop over the list <em>&#8216;my_list&#8217;<\/em>. We shall check using <em>not(pd.isnull()) <\/em>whether the list item is NaN or not and accordingly append that item into a new list named <em>&#8216;new_list&#8217;.<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nmy_list = &#x5B;'Mike', 'Harry', nan, 'Emma',nan,nan]\nnew_list = &#x5B;item for item in my_list if not(pd.isnull(item)) == True]\nprint(new_list)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">['Mike', 'Harry', 'Emma']<\/pre>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-background\" style=\"background-color:#e4eef3;font-size:19px\"><strong>Also, Read |<\/strong><span style=\"text-decoration: underline;\"> <a href=\"http:\/\/www.pythonpool.com\/numpy-array-to-pandas-dataframe\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Convert Numpy Array to Pandas Dataframe<\/a><\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-entire-code-is-2\"><span class=\"ez-toc-section\" id=\"The_Entire_Code_is-2\"><\/span>The Entire Code is:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pandas as pd\nfrom numpy import nan\nmy_list = &#x5B;'Mike', 'Harry', nan, 'Emma',nan,nan]\nnew_list = &#x5B;item for item in my_list if not(pd.isnull(item)) == True]\nprint(new_list)\n<\/pre><\/div>\n\n\n<p>Alternatively, we can also use the <em>isna()<\/em> function present in pandas similarly. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pandas as pd\nfrom numpy import nan\nmy_list = &#x5B;'Mike', 'Harry', nan, 'Emma',nan,nan]\nnew_list = &#x5B;item for item in my_list if not(pd.isna(item)) == True]\nprint(new_list)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">['Mike', 'Harry', 'Emma']<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-python-remove-nan-from-list-using-for-loop\"><span class=\"ez-toc-section\" id=\"4_Python_Remove_nan_from_List_Using_for_loop\"><\/span>4. Python Remove nan from List Using for loop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This is the most basic and effective method for removing nan values from the python list. We will run a for loop over the length of the list. If we encounter a not NaN value, we shall append that value to a new list. The new list will not contain any nan values.<\/p>\n\n\n\n<p>First, we will have to import nan from the numpy library. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom numpy import nan\n<\/pre><\/div>\n\n\n<p>Now, we shall create a list named <em>my_list.<\/em> The list contains three string values and three NaN values. We shall also define an empty list named <em>&#8216;new_list.&#8217;<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nmy_list = &#x5B;'Mike', 'Harry', nan, 'Emma',nan,nan]\nnew_list = &#x5B;]\n<\/pre><\/div>\n\n\n<p>Now, we shall run a for loop over <em>my_list.<\/em> Inside the for loop, we shall place an if condition, which will check if the current list item is a NaN value or not. If it is not NaN, then we will append it to the list  &#8216;new_list&#8217;. Then at the end, we shall print that list. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfor item in my_list:\n  if str(item) != 'nan':\n    new_list.append(item)\nprint(new_list)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">['Mike', 'Harry', 'Emma']<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-entire-code-is-3\"><span class=\"ez-toc-section\" id=\"The_entire_code_is-2\"><\/span><strong>The entire code is:<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom numpy import nan\nmy_list = &#x5B;'Mike', 'Harry', nan, 'Emma',nan,nan]\nnew_list = &#x5B;]\nfor item in my_list:\n  if str(item) != 'nan':\n    new_list.append(item)\n\nprint(new_list)\n<\/pre><\/div>\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-alpha monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Trending<\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\" style=\"font-size:19px;\" href=\"https:\/\/www.pythonpool.com\/solved-runtimeerror-cuda-error-invalid-device-ordinal\/\">[Solved] runtimeerror: cuda error: invalid device ordinal<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-with-list-comprehension\"><span class=\"ez-toc-section\" id=\"5_With_list_comprehension\"><\/span>5. With list comprehension <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>List comprehension is an effective way of generating new sequences from already existing sequences. It is a compact piece of one-line code with which we can loop over a sequence. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-syntax-of-list-comprehension-is\"><span class=\"ez-toc-section\" id=\"The_syntax_of_list_comprehension_is\"><\/span>The syntax of list comprehension is:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>[expression for item in list if-condition]<\/em><\/pre>\n\n\n\n<p>The expression is the item to be included in the sequence. The expression is followed by a for loop. We can also mention an if condition at the end if required. The code works similarly to using a for loop. The only difference is that it has lesser lines of code and thus more efficient.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom numpy import nan\nmy_list = &#x5B;'Mike', 'Harry', nan, 'Emma',nan,nan]\nnew_list = &#x5B;item for item in my_list if str(item) != 'nan']\nprint(new_list)\n<\/pre><\/div>\n\n\n<p><strong>The output is:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">['Mike', 'Harry', 'Emma']<\/pre>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-golf monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\" style=\"font-size:19px;\" href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-type-numpy-ndarray-doesnt-define-__round__-method\/\">[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<p>That sums up different ways in python to remove NaN values from the list. If you have any questions in your mind or any thoughts to share, don&#8217;t forget to leave them in the comments below. <\/p>\n\n\n\n<p><em>Until next time, Keep Learning!<\/em><\/p>\n\n\n<div class=\"monsterinsights-widget-popular-posts monsterinsights-widget-popular-posts-charlie monsterinsights-popular-posts-styled monsterinsights-widget-popular-posts-columns-1\"><h2 class=\"monsterinsights-widget-popular-posts-widget-title\"><span class=\"ez-toc-section\" id=\"Popular_Right_Now\"><\/span>Popular Right Now<span class=\"ez-toc-section-end\"><\/span><\/h2><ul class=\"monsterinsights-widget-popular-posts-list\"><li style=\"border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:18px;\">[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><li style=\"border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:18px;\">[Fixed] nameerror: name Unicode is not defined<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><li style=\"border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/solved-runtimeerror-cuda-error-invalid-device-ordinal\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:18px;\">[Solved] runtimeerror: cuda error: invalid device ordinal<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><li style=\"border-color:#CD3034;\"><a href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-type-numpy-ndarray-doesnt-define-__round__-method\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" style=\"font-size:18px;\">[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><\/div><\/div><\/a><\/li><\/ul><\/div><p><\/p>","protected":false},"excerpt":{"rendered":"<p>In Python, NaN stands for Not a Number. It is used to represent values that are not present in a dataset or file. It is &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"5 Easy Ways in Python to Remove Nan from List\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#more-14310\" aria-label=\"More on 5 Easy Ways in Python to Remove Nan from List\">Read more<\/a><\/p>\n","protected":false},"author":20,"featured_media":14327,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[4319,4317,4318,4320],"class_list":["post-14310","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-python-remove-nan-from-list","tag-python-remove-nan-from-list-of-strings","tag-remove-nan-from-a-list-python","tag-remove-nan-from-python-list","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>5 Easy Ways in Python to Remove Nan from List - Python Pool<\/title>\n<meta name=\"description\" content=\"In Python to remove nan values from list, we can use loop statements or several in built functions from pandas, numpy and math library.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 Easy Ways in Python to Remove Nan from List\" \/>\n<meta property=\"og:description\" content=\"In Python, NaN stands for Not a Number. It is used to represent values that are not present in a dataset or file. It is categorized as a special\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-07T02:48:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-07T08:58:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dhruvi Vikma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dhruvi Vikma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\"},\"author\":{\"name\":\"Dhruvi Vikma\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/bed8fc40c7b71baf7d76b1cfefd79f23\"},\"headline\":\"5 Easy Ways in Python to Remove Nan from List\",\"datePublished\":\"2021-07-07T02:48:50+00:00\",\"dateModified\":\"2023-05-07T08:58:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\"},\"wordCount\":939,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg\",\"keywords\":[\"python remove nan from list\",\"python remove nan from list of strings\",\"remove nan from a list python\",\"remove nan from python list\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\",\"name\":\"5 Easy Ways in Python to Remove Nan from List - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg\",\"datePublished\":\"2021-07-07T02:48:50+00:00\",\"dateModified\":\"2023-05-07T08:58:21+00:00\",\"description\":\"In Python to remove nan values from list, we can use loop statements or several in built functions from pandas, numpy and math library.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg\",\"width\":1200,\"height\":628,\"caption\":\"python remove nan from list\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"5 Easy Ways in Python to Remove Nan from List\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/bed8fc40c7b71baf7d76b1cfefd79f23\",\"name\":\"Dhruvi Vikma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/520d8a37e8b6ce4e6df57e997dc0d571225f48098bbb02838c3884bb603e886f?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/520d8a37e8b6ce4e6df57e997dc0d571225f48098bbb02838c3884bb603e886f?s=96&d=wavatar&r=g\",\"caption\":\"Dhruvi Vikma\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"5 Easy Ways in Python to Remove Nan from List - Python Pool","description":"In Python to remove nan values from list, we can use loop statements or several in built functions from pandas, numpy and math library.","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:\/\/www.pythonpool.com\/python-remove-nan-from-list\/","og_locale":"en_US","og_type":"article","og_title":"5 Easy Ways in Python to Remove Nan from List","og_description":"In Python, NaN stands for Not a Number. It is used to represent values that are not present in a dataset or file. It is categorized as a special","og_url":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/","og_site_name":"Python Pool","article_published_time":"2021-07-07T02:48:50+00:00","article_modified_time":"2023-05-07T08:58:21+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg","type":"image\/jpeg"}],"author":"Dhruvi Vikma","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Dhruvi Vikma","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/"},"author":{"name":"Dhruvi Vikma","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/bed8fc40c7b71baf7d76b1cfefd79f23"},"headline":"5 Easy Ways in Python to Remove Nan from List","datePublished":"2021-07-07T02:48:50+00:00","dateModified":"2023-05-07T08:58:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/"},"wordCount":939,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg","keywords":["python remove nan from list","python remove nan from list of strings","remove nan from a list python","remove nan from python list"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/","url":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/","name":"5 Easy Ways in Python to Remove Nan from List - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg","datePublished":"2021-07-07T02:48:50+00:00","dateModified":"2023-05-07T08:58:21+00:00","description":"In Python to remove nan values from list, we can use loop statements or several in built functions from pandas, numpy and math library.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/07\/Easy-Ways-in-Python-to-Remove-Nan-from-List.jpg","width":1200,"height":628,"caption":"python remove nan from list"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-remove-nan-from-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"5 Easy Ways in Python to Remove Nan from List"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/bed8fc40c7b71baf7d76b1cfefd79f23","name":"Dhruvi Vikma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/520d8a37e8b6ce4e6df57e997dc0d571225f48098bbb02838c3884bb603e886f?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/520d8a37e8b6ce4e6df57e997dc0d571225f48098bbb02838c3884bb603e886f?s=96&d=wavatar&r=g","caption":"Dhruvi Vikma"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/14310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=14310"}],"version-history":[{"count":20,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/14310\/revisions"}],"predecessor-version":[{"id":27756,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/14310\/revisions\/27756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/14327"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=14310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=14310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=14310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}