{"id":10317,"date":"2021-03-30T08:56:09","date_gmt":"2021-03-30T03:26:09","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=10317"},"modified":"2021-06-14T16:36:58","modified_gmt":"2021-06-14T11:06:58","slug":"numpy-random-permutation","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/","title":{"rendered":"Numpy Permutation() | How to use np.random.permutation()"},"content":{"rendered":"\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\/numpy-random-permutation\/#Introduction\" >Introduction<\/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\/numpy-random-permutation\/#What_is_Numpy_Permutation\" >What is Numpy Permutation?<\/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\/numpy-random-permutation\/#Syntax\" >Syntax<\/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\/numpy-random-permutation\/#Parameters_of_nprandompermutation\" >Parameters of np.random.permutation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#Return_Value_of_nprandompermutation\" >Return Value of np.random.permutation<\/a><\/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\/numpy-random-permutation\/#Example_of_nprandompermutation\" >Example of np.random.permutation<\/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\/numpy-random-permutation\/#1_Taking_x_parameter_as_a_integer\" >1.  Taking x parameter as a integer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#2_Taking_x_parameter_as_a_array_on_nprandompermutation\" >2. Taking x parameter as a array on np.random.permutation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#3_Using_arange_and_reshape_function_on_nprandompermutation\" >3. Using arange and reshape function on np.random.permutation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#4_Implementing_graph_of_permutation_on_nprandompermutation\" >4. Implementing graph of permutation on np.random.permutation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#Difference_between_permutation_and_shuffle_function\" >Difference between permutation and shuffle function<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#Nprandompermutation\" >Np.random.permutation()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#Numpyrandomshuffle\" >Numpy.random.shuffle()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#Example\" >Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-introduction\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this tutorial, We will learn how to find the <a href=\"http:\/\/www.pythonpool.com\/python-permutations\/\" target=\"_blank\" rel=\"noreferrer noopener\">permutation<\/a> of the numpy array. We can find the permutation of the numpy array using np.random.permutation() function. we will learn the calculation of this function in deep. We will give you a thorough explanation of every part of the code with examples.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-numpy-permutation\"><span class=\"ez-toc-section\" id=\"What_is_Numpy_Permutation\"><\/span>What is Numpy Permutation?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Numpy<\/strong> is a toolkit that helps us in working with numeric data. It contains a set of tools for creating a data structure called a Numpy array. It is basically a row and column grid of numbers.<\/p>\n\n\n\n<p><strong>Numpy. random. permutation() function gives us the random samples of a sequence of permutation and returns sequence by using this method.<\/strong> If&nbsp;<em>x<\/em>&nbsp;is a multi-dimensional array, it is only shuffled along with its first index.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-syntax\"><span class=\"ez-toc-section\" id=\"Syntax\"><\/span>Syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>numpy.random.permutation(x)<\/strong><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parameters-of-np-random-permutation\"><span class=\"ez-toc-section\" id=\"Parameters_of_nprandompermutation\"><\/span>Parameters of np.random.permutation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>x:<\/strong> It is an array. If the input in x is an integer value, then&nbsp;it randomly permutes np. arange(x). If the input in x is an array, then it makes a copy and shuffles the elements randomly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-return-value-of-np-random-permutation\"><span class=\"ez-toc-section\" id=\"Return_Value_of_nprandompermutation\"><\/span>Return Value of np.random.permutation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The np.random.permutation() function returns the permuted sequence or an array range.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-example-of-np-random-permutation\"><span class=\"ez-toc-section\" id=\"Example_of_nprandompermutation\"><\/span>Example of np.random.permutation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let us understand the permutation function of the numpy module in detail with the help of different examples:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-taking-x-parameter-as-a-integer\"><span class=\"ez-toc-section\" id=\"1_Taking_x_parameter_as_a_integer\"><\/span>1.  Taking x parameter as a integer<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be importing a numpy library. Then, we will be taking input x(parameter) as an integer. After that, we will apply the permutation function and see the output.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#importing numpy library\nimport numpy as np\n\nresult = np.random.permutation(8)\nprint(&quot;Output : &quot;,result)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"> <strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output :  &#91;1 4 0 7 3 5 6 2]<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will import a numpy module with an alias name as np.<\/li><li>Then, we will take the variable result in which we have applied the permutation() function.<\/li><li>At last, we have printed the output stored in the result variable.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-taking-x-parameter-as-a-array-on-np-random-permutation\"><span class=\"ez-toc-section\" id=\"2_Taking_x_parameter_as_a_array_on_nprandompermutation\"><\/span>2. Taking x parameter as a array on np.random.permutation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be importing a numpy library. Then, we will be taking input x(parameter) as an array. After that, we will apply the permutation function and see the output.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#importing numpy library\nimport numpy as np\n\narr = &#x5B;1,2,3,4,5,6]\nresult = np.random.permutation(arr)\nprint(&quot;Output : &quot;,result)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output :  &#91;1 5 3 2 6 4]<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\" id=\"block-3dc9dea7-2bc3-44e3-9a45-3f165636ad30\"><li>Firstly, we will import a numpy module with an alias name as np.<\/li><li>Then, we will take an input array in the variable named arr.<\/li><li>Then, we will take the variable result in which we have applied the permutation() function passing the input array in it.<\/li><li>At last, we have printed the output stored in the result variable.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-using-arange-and-reshape-function-on-np-random-permutation\"><span class=\"ez-toc-section\" id=\"3_Using_arange_and_reshape_function_on_nprandompermutation\"><\/span>3. Using arange and reshape function on np.random.permutation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be importing the numpy library. Then, we will be using the np. arange and reshape function from the numpy library. After that, we will apply the permutation function and see the output.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#importing numpy library\nimport numpy as np\n\narr = np.arange(16).reshape((4, 4))\nresult = np.random.permutation(arr)\nprint(&quot;output : &quot;,result)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>output :  &#91;&#91; 4  5  6  7]\n &#91; 0  1  2  3]\n &#91; 8  9 10 11]\n &#91;12 13 14 15]]<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\" id=\"block-3dc9dea7-2bc3-44e3-9a45-3f165636ad30\"><li>Firstly, we will import a numpy module with an alias name as np.<\/li><li>Then, we will take an input variable <strong>&#8216;arr&#8217;<\/strong> in which we have applied numpy arrange() function with <strong>reshape()<\/strong>.<\/li><li>Then, we will take the variable result in which we have applied the permutation() function passing the input array in it.<\/li><li>At last, we have printed the output stored in the result variable.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-implementing-graph-of-permutation-on-np-random-permutation\"><span class=\"ez-toc-section\" id=\"4_Implementing_graph_of_permutation_on_nprandompermutation\"><\/span>4. Implementing graph of permutation on np.random.permutation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be importing the numpy module and matplotlib module. Then, we will apply the permutation function with the value as an integer. After that, we will apply the graph function and print the output. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# import numpy\nimport numpy as np\nimport matplotlib.pyplot as plt\n  \n# Using permutation() method\narr = np.random.permutation(100)\n  \nc, bin, ig = plt.hist(arr, 15, density = True)\nplt.show()\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"435\" height=\"272\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/fesgdgd.png\" alt=\"Implementing Graph Of Permutation On Np.Random.Permutation\" class=\"wp-image-10318\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/fesgdgd.png 435w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/fesgdgd-300x188.png 300w\" sizes=\"(max-width: 435px) 100vw, 435px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will be importing the numpy module with an alias name as np and <strong>matplotlib. pyplot<\/strong> as plt.<\/li><li>Then, we will use the permutation function and store the output in the arr variable.<\/li><li>After that, we will be applying the plt library with hist function to make the <a href=\"http:\/\/www.pythonpool.com\/matplotlib-2d-histogram\/\" target=\"_blank\" rel=\"noreferrer noopener\">histogram<\/a> with their parameters.<\/li><li>At last, we have printed the output.<\/li><li>Hence, you can see the output.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-difference-between-permutation-and-shuffle-function\"><span class=\"ez-toc-section\" id=\"Difference_between_permutation_and_shuffle_function\"><\/span>Difference between permutation and shuffle function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-np-random-permutation\"><span class=\"ez-toc-section\" id=\"Nprandompermutation\"><\/span>Np.random.permutation()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>Numpy.random.permutation() function gives us the random samples of a sequence of permutation and returns sequence by using this method.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-numpy-random-shuffle\"><span class=\"ez-toc-section\" id=\"Numpyrandomshuffle\"><\/span>Numpy.random.shuffle()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong><a href=\"http:\/\/www.pythonpool.com\/numpy-shuffle\/\" target=\"_blank\" rel=\"noreferrer noopener\">Numpy.random.shuffle()<\/a> function gives us the modified sequence in-place by shuffling its contents.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example\"><span class=\"ez-toc-section\" id=\"Example\"><\/span>Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be importing the numpy library. Then, we will take an input array as input. After that, we will be applying both the function permutation and <a href=\"https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.shuffle.html\" target=\"_blank\" rel=\"noreferrer noopener\">shuffle<\/a>. Then, see the necessary changes by seeding the output.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#importing numpy library\nimport numpy as np\n\n#taking input for permutaion and shuffle function\narr = &#x5B;2,4,6,8,10]\n\n#applying permutation function\nresult = np.random.permutation(arr)\n\n#applyimg shuffle function\nresults = np.random.shuffle(arr)\n\n#printing both the result\nprint(&quot;Permutation output : &quot;,result)\nprint(&quot;shuffle output : &quot;,results) \n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Permutation output :  &#91; 4  8  6  2 10]\nshuffle output :  &#91;4, 6, 2, 8, 10]<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we have imported the numpy library with an alias name as np.<\/li><li>Then, we have taken the input array in the variable as arr.<\/li><li>After that, we have applied the numpy permutation() with passing the input array parameter.<\/li><li>Then, we have applied the shuffle() function and stored the output in the results variable.<\/li><li>At last, we have printed both the output and see the changes in the output.<\/li><li>Hence, you can see the output.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this tutorial, we have learned about the concept of numpy random permutation. We have discussed all the ways through which we can use the permutation concept and also discussed the example in detail. We have also discussed the difference between the numpy permutation() and numpy shuffle() with the example explained in detail. You can use the permutation function as required by you in the program.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this tutorial, We will learn how to find the permutation of the numpy array. We can find the permutation of the numpy array &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Numpy Permutation() | How to use np.random.permutation()\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#more-10317\" aria-label=\"More on Numpy Permutation() | How to use np.random.permutation()\">Read more<\/a><\/p>\n","protected":false},"author":17,"featured_media":10336,"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":[1495],"tags":[3790,3792,3793],"class_list":["post-10317","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-numpy","tag-np-random-permutation-seed","tag-numpy-permutaion","tag-numpy-random-permutation-python","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>Numpy Permutation() | How to use np.random.permutation() - Python Pool<\/title>\n<meta name=\"description\" content=\"Np.random.permutation() function gives us the random samples of a sequence of permutation and returns sequence by using this method.\" \/>\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\/numpy-random-permutation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Numpy Permutation() | How to use np.random.permutation()\" \/>\n<meta property=\"og:description\" content=\"Introduction In this tutorial, We will learn how to find the permutation of the numpy array. We can find the permutation of the numpy array using\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-30T03:26:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T11:06:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1350\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Siddharth Jain\" \/>\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=\"Siddharth Jain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/\"},\"author\":{\"name\":\"Siddharth Jain\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/75a3240fabe5ea90200777a9d8d3b4fa\"},\"headline\":\"Numpy Permutation() | How to use np.random.permutation()\",\"datePublished\":\"2021-03-30T03:26:09+00:00\",\"dateModified\":\"2021-06-14T11:06:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/\"},\"wordCount\":872,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png\",\"keywords\":[\"np.random.permutation seed\",\"numpy permutaion\",\"numpy random permutation python\"],\"articleSection\":[\"Numpy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/\",\"url\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/\",\"name\":\"Numpy Permutation() | How to use np.random.permutation() - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png\",\"datePublished\":\"2021-03-30T03:26:09+00:00\",\"dateModified\":\"2021-06-14T11:06:58+00:00\",\"description\":\"Np.random.permutation() function gives us the random samples of a sequence of permutation and returns sequence by using this method.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png\",\"width\":1350,\"height\":650,\"caption\":\"np.random.permutation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Numpy Permutation() | How to use np.random.permutation()\"}]},{\"@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\/75a3240fabe5ea90200777a9d8d3b4fa\",\"name\":\"Siddharth Jain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g\",\"caption\":\"Siddharth Jain\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Numpy Permutation() | How to use np.random.permutation() - Python Pool","description":"Np.random.permutation() function gives us the random samples of a sequence of permutation and returns sequence by using this method.","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\/numpy-random-permutation\/","og_locale":"en_US","og_type":"article","og_title":"Numpy Permutation() | How to use np.random.permutation()","og_description":"Introduction In this tutorial, We will learn how to find the permutation of the numpy array. We can find the permutation of the numpy array using","og_url":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/","og_site_name":"Python Pool","article_published_time":"2021-03-30T03:26:09+00:00","article_modified_time":"2021-06-14T11:06:58+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png","type":"image\/png"}],"author":"Siddharth Jain","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Siddharth Jain","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/"},"author":{"name":"Siddharth Jain","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/75a3240fabe5ea90200777a9d8d3b4fa"},"headline":"Numpy Permutation() | How to use np.random.permutation()","datePublished":"2021-03-30T03:26:09+00:00","dateModified":"2021-06-14T11:06:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/"},"wordCount":872,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png","keywords":["np.random.permutation seed","numpy permutaion","numpy random permutation python"],"articleSection":["Numpy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/numpy-random-permutation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/","url":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/","name":"Numpy Permutation() | How to use np.random.permutation() - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png","datePublished":"2021-03-30T03:26:09+00:00","dateModified":"2021-06-14T11:06:58+00:00","description":"Np.random.permutation() function gives us the random samples of a sequence of permutation and returns sequence by using this method.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/numpy-random-permutation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/03\/numpy-random-permutation.png","width":1350,"height":650,"caption":"np.random.permutation"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/numpy-random-permutation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Numpy Permutation() | How to use np.random.permutation()"}]},{"@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\/75a3240fabe5ea90200777a9d8d3b4fa","name":"Siddharth Jain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g","caption":"Siddharth Jain"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/10317","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\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=10317"}],"version-history":[{"count":12,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/10317\/revisions"}],"predecessor-version":[{"id":13638,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/10317\/revisions\/13638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/10336"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=10317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=10317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=10317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}