{"id":860,"date":"2022-09-22T15:41:00","date_gmt":"2022-09-22T10:11:00","guid":{"rendered":"https:\/\/geekpython.in\/?p=860"},"modified":"2023-08-15T16:22:00","modified_gmt":"2023-08-15T10:52:00","slug":"numpy-argmax-function-in-python","status":"publish","type":"post","link":"https:\/\/geekpython.in\/numpy-argmax-function-in-python","title":{"rendered":"Understanding numpy.argmax() Function In Python"},"content":{"rendered":"\n<p><a target=\"_blank\" href=\"https:\/\/numpy.org\/doc\/stable\/user\/whatisnumpy.html\" rel=\"noreferrer noopener\">NumPy<\/a>&nbsp;is most often used to handle or work with arrays (multidimensional, masked) and matrices. It has a collection of functions and methods to operate on arrays like statistical operations, mathematical and logical operations, shape manipulation, linear algebra, and much more.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-argmax-function\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-argmax-function\"><\/a>Argmax function<\/h1>\n\n\n\n<p><a target=\"_blank\" href=\"https:\/\/numpy.org\/doc\/stable\/reference\/generated\/numpy.argmax.html\" rel=\"noreferrer noopener\">numpy.argmax()<\/a>&nbsp;is one of the functions provided by NumPy that is used to&nbsp;<strong>return the indices of the maximum element along an axis from the specified array<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-syntax\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-syntax\"><\/a>Syntax<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>numpy.argmax(a, axis=None, out=None)<\/p>\n<\/blockquote>\n\n\n\n<p>Parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>a<\/code>&nbsp;&#8211; The input array we will work on<\/li>\n\n\n\n<li><code>axis<\/code>&nbsp;&#8211; It is optional. We can specify an axis like 1 or 0 to find the maximum value index horizontally or vertically.<\/li>\n\n\n\n<li><code>out<\/code>&nbsp;&#8211; By default, it is None. It provides a feature to insert the output to the out array, but the array should be of appropriate shape and dtype.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Return value<\/p>\n\n\n\n<p>The array of integers is returned with the indices of max values from the array&nbsp;<code>a<\/code>&nbsp;with the same shape as&nbsp;<code>a.shape<\/code>&nbsp;with the dimension along the&nbsp;<strong><em>axis<\/em><\/strong>&nbsp;removed.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-finding-the-index-of-the-max-element\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-finding-the-index-of-the-max-element\"><\/a>Finding the index of the max element<\/h3>\n\n\n\n<p>Let&#8217;s see the basic example to find the index of the max element in the array.<\/p>\n\n\n\n<p><strong>Working with a 1D array without specifying the axis<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Working with a 1D array\ninp_arr = np.array([5, 2, 9, 4, 2])\n\n# Applying argmax() function\nmax_elem_index = np.argmax(inp_arr)\n\n# Printing index\nprint(\"MAX ELEMENT INDEX:\", max_elem_index)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">MAX ELEMENT INDEX: 2<\/pre><\/div>\n\n\n\n<p><strong>Working with a 2D array without specifying the axis<\/strong><\/p>\n\n\n\n<p>When we work with 2D arrays in numpy and try to find the index of the max element without specifying the axis, the array we are working on has the element index the same as the 1D array or flattened array.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"1000\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/1-3.png\" alt=\"Finding the index of the max element in a 2D array without specifying the axis\" class=\"wp-image-862\"\/><\/figure>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Creating 2D array\narr = np.random.randint(16, size=(4, 4))\n\n# Array preview\nprint(\"INPUT ARRAY: \\n\", arr)\n\n# Applying argmax()\nelem_index = np.argmax(arr)\n\n# Displaying max element index\nprint(\"\\nMAX ELEMENT INDEX:\", elem_index)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">INPUT ARRAY: \n [[ 5  5  4 12]\n [12 15 13  0]\n [11 13  2  6]\n [ 6  8  8  9]]\n\nMAX ELEMENT INDEX: 5<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-finding-the-index-of-the-max-element-along-the-axis\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-finding-the-index-of-the-max-element-along-the-axis\"><\/a>Finding the index of the max element along the axis<\/h3>\n\n\n\n<p>Things will change when we specify the axis and try to find the index of the max element along it.<\/p>\n\n\n\n<p><strong>When the axis is 0<\/strong><\/p>\n\n\n\n<p>When we specify the&nbsp;<code>axis=0<\/code>, then the&nbsp;<strong><em>argmax<\/em><\/strong>&nbsp;function will find the index of the max element vertically in the multidimensional array that the user specified. Let&#8217;s understand it by an illustration below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"1000\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/2-4.png\" alt=\"Finding the indices of the max elements along axis 0\" class=\"wp-image-863\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>In the above illustration,&nbsp;<em>argmax()<\/em>&nbsp;function returned the max element index from the 1<sup>st<\/sup>&nbsp;column which is&nbsp;<strong>1<\/strong>&nbsp;and then returned the max element index from the 2<sup>nd<\/sup>&nbsp;column which is again&nbsp;<strong>1<\/strong>, and the same does for the 3<sup>rd<\/sup>&nbsp;and the 4<sup>th<\/sup>&nbsp;column.<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Creating 2D array\narr = np.random.randint(16, size=(4, 4))\n\n# Array preview\nprint(\"INPUT ARRAY: \\n\", arr)\n\n# Applying argmax()\nelem_index = np.argmax(arr, axis=0)\n\n# Displaying max element index\nprint(\"\\nMAX ELEMENT INDEX:\", elem_index)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">INPUT ARRAY: \n [[ 8  6 10  3]\n [ 4  5  9  1]\n [ 6 15 13 13]\n [ 4 14 15 13]]\n\nMAX ELEMENT INDEX: [0 2 3 2]<\/pre><\/div>\n\n\n\n<p><strong>When the axis is 1<\/strong><\/p>\n\n\n\n<p>When we specify the&nbsp;<code>axis=1<\/code>, the&nbsp;<strong><em>argmax<\/em><\/strong>&nbsp;function will find the index of the max element horizontally in the multidimensional array that the user specified. Let&#8217;s understand it by an illustration below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"1000\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/3-2.png\" alt=\"Finding the indices of the max elements along axis 1\" class=\"wp-image-864\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>In the above illustration,&nbsp;<em>argmax()<\/em>&nbsp;function returned the max element index from the 1<sup>st<\/sup>&nbsp;row which is&nbsp;<strong>2<\/strong>&nbsp;and then returned the max element index from the 2<sup>nd<\/sup>&nbsp;row which is&nbsp;<strong>1<\/strong>, and the same does for the 3<sup>rd<\/sup>&nbsp;and the 4<sup>th<\/sup>&nbsp;row.<\/p>\n<\/blockquote>\n\n\n\n<p><strong>Code example<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Creating 2D array\narr = np.random.randint(12, size=(4, 3))\n\n# Array preview\nprint(\"INPUT ARRAY: \\n\", arr)\n\n# Applying argmax()\nelem_index = np.argmax(arr, axis=1)\n\n# Displaying max element index\nprint(\"\\nMAX ELEMENT INDEX:\", elem_index)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">INPUT ARRAY: \n [[ 7  8  0]\n [ 3  0 11]\n [ 7  6  0]\n [10  8  1]]\n\nMAX ELEMENT INDEX: [1 2 0 0]<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-multiple-occurrences-of-the-highest-value\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-multiple-occurrences-of-the-highest-value\"><\/a>Multiple occurrences of the highest value<\/h3>\n\n\n\n<p>Sometimes, we can come across multidimensional arrays with multiple occurrences of the highest values along the particular axis, then what will happen?<\/p>\n\n\n\n<p>The&nbsp;<strong><em>argmax()<\/em><\/strong>&nbsp;function will return&nbsp;<strong>the index of the highest value that occurs first in a particular axis<\/strong>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Illustration showing multiple occurrences of the highest values along axis 0.<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"1000\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/4-2.png\" alt=\"Multiple occurrences of the highest values along axis 0\" class=\"wp-image-865\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Illustration showing multiple occurrences of the highest values along axis 1.<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"1000\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/5-2.png\" alt=\"Multiple occurrences of the highest values along axis 1\" class=\"wp-image-866\"\/><\/figure>\n\n\n\n<p><strong>Code example<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Defining the array\narr = np.array([[2, 14, 9, 4, 5],\n                [7, 14, 53, 10, 4],\n                [91, 2, 41, 6, 91]])\n\n# Displaying the highest element index along axis 0\nprint(\"MAX ELEMENT INDEX:\", np.argmax(arr, axis=0))\n\n# Displaying the highest element index along axis 1\nprint(\"\\nMAX ELEMENT INDEX:\", np.argmax(arr, axis=1))\n\n# Flattening the array, making it a 1D array\nflattened_arr = arr.flatten()\nprint(\"\\nThe array is flattened into 1D array:\", flattened_arr)\n\n# Displaying the highest element index\nprint(\"\\nMAX ELEMENT INDEX:\", np.argmax(flattened_arr))<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">MAX ELEMENT INDEX: [2 0 1 1 2]\n\nMAX ELEMENT INDEX: [1 2 0]\n\nThe array is flattened into 1D array: [ 2 14  9  4  5  7 14 53 10  4 91  2 41  6 91]\n\nMAX ELEMENT INDEX: 10<\/pre><\/div>\n\n\n\n<p><strong>Explanation<\/strong><\/p>\n\n\n\n<p>In the above code, when we try to find the indices of the max elements along the&nbsp;<strong><em>axis 0<\/em><\/strong>, we got an array with values&nbsp;<code>[2 0 1 1 2]<\/code>, if we look at the&nbsp;<strong>2<sup>nd<\/sup><\/strong>&nbsp;column, 14 is the highest value at the&nbsp;<strong>0<sup>th<\/sup><\/strong>&nbsp;and the&nbsp;<strong>1<sup>st<\/sup><\/strong>&nbsp;index, we got&nbsp;<code>0<\/code>&nbsp;because the value 14 at the 0<sup>th<\/sup>&nbsp;index occurred first when finding the highest value.<\/p>\n\n\n\n<p>The same goes for the array we obtained in the second output when we provided the&nbsp;<strong><em>axis 1<\/em><\/strong>, in the&nbsp;<strong>3<sup>rd<\/sup><\/strong>&nbsp;row, 91 is the highest value at the&nbsp;<strong>0<sup>th<\/sup><\/strong>&nbsp;and the&nbsp;<strong>4<sup>th<\/sup><\/strong>&nbsp;index, the value 91 at the&nbsp;<strong>0<sup>th<\/sup><\/strong>&nbsp;index occurred first when finding the highest value hence we got output&nbsp;<code>0<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-using-the-out-parameter\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-using-the-out-parameter\"><\/a>Using the&nbsp;<strong><em>out<\/em><\/strong>&nbsp;parameter<\/h3>\n\n\n\n<p>The&nbsp;<code>out<\/code>&nbsp;parameter in&nbsp;<strong><em>numpy.argmax()<\/em><\/strong>&nbsp;function is optional and by default it is None.<\/p>\n\n\n\n<p>The&nbsp;<code>out<\/code>&nbsp;parameter stores the output array(containing indices of the max elements in a particular axis) in a numpy array. The array specified in the out parameter should be of&nbsp;<strong>shape<\/strong>&nbsp;and&nbsp;<strong>dtype<\/strong>, the same as the input array.<\/p>\n\n\n\n<p><strong>Code Example<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Creating array filled with zeroes which then be replaced\nout_array = np.zeros((4,), dtype=int)\nprint(\"ARRAY w\/ ZEROES:\", out_array)\n\n# Input array\narr = np.random.randint(16, size=(4, 4))\nprint(\"INPUT ARRAY:\\n\", arr)\n\n# Storing the indices of the max elements(axis=1) in the out_array\nprint(\"\\nAXIS 1:\", np.argmax(arr, axis=1, out=out_array))\n\n# Storing the indices of the max elements(axis=0) in the out_array\nprint(\"\\nAXIS 0:\", np.argmax(arr, axis=0, out=out_array))<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">ARRAY w\/ ZEROES: [0 0 0 0]\nINPUT ARRAY:\n [[ 4  2 14 15]\n [ 6 15  2  1]\n [13  6 13  3]\n [ 5  1 13  9]]\n\nAXIS 1: [3 1 0 2]\n\nAXIS 0: [2 1 0 0]<\/pre><\/div>\n\n\n\n<p><strong>Explanation<\/strong><\/p>\n\n\n\n<p>We created an array filled with zeroes named&nbsp;<code>out_array<\/code>, and we defined the&nbsp;<strong><em>shape<\/em><\/strong>&nbsp;and&nbsp;<strong><em>dtype<\/em><\/strong>&nbsp;same as the input array and then used the&nbsp;<code>numpy.argmax()<\/code>&nbsp;function to get the indices of the max elements along the axis 1 and 0 and stored them in the&nbsp;<code>out_array<\/code>&nbsp;that we defined earlier.<\/p>\n\n\n\n<p>The&nbsp;<code>numpy.zeros()<\/code>&nbsp;has by default&nbsp;<strong><em>dtype<\/em><\/strong>&nbsp;<code>float<\/code>&nbsp;that&#8217;s why we defined the&nbsp;<strong><em>dtype<\/em><\/strong>&nbsp;in the above code because our input array has the&nbsp;<code>dtype=int<\/code>.<\/p>\n\n\n\n<p><strong>If we didn&#8217;t specify the dtype in the above code, it would throw an error<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Importing Numpy\nimport numpy as np\n\n# Creating array filled with zeroes without specifying dtype\nout_array = np.zeros((4,))\nprint(\"ARRAY w\/ ZEROES:\", out_array)\n\n# Input array\narr = np.random.randint(16, size=(4, 4))\nprint(\"INPUT ARRAY:\\n\", arr)\n\nprint(\"\\nAXIS 1:\", np.argmax(arr, axis=1, out=out_array))<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">ARRAY w\/ ZEROES: [0. 0. 0. 0.]\nINPUT ARRAY:\n [[14  9  3  4]\n [ 9  2  4  8]\n [ 5  1  9  1]\n [ 6  0 10  7]]\n\nTypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'<\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-conclusion\"><a href=\"https:\/\/geekpython.in\/numpy-argmax-function-in-python#heading-conclusion\"><\/a>Conclusion<\/h1>\n\n\n\n<p>That was the insight of the argmax() function in NumPy. Let&#8217;s review what we&#8217;ve learned:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>numpy.argmax()<\/code>&nbsp;function returns the index of the highest value in an array. If the maximum value occurs more than once in an array(multidimensional or flattened array), then the&nbsp;<strong><em>argmax()<\/em><\/strong>&nbsp;function will return the index of the highest value which occurred first.<\/li>\n\n\n\n<li>We can specify the axis parameter when working with a multidimensional array to get the result along a particular axis. If we specify&nbsp;<strong>axis=0<\/strong>, then we&#8217;ll get the index of the highest values vertically in the multidimensional array, and for&nbsp;<strong>axis=1<\/strong>, we&#8217;ll get the result horizontally in the multidimensional array.<\/li>\n\n\n\n<li>We can store the output in another array specified in the&nbsp;<strong>out<\/strong>&nbsp;parameter; however, the array should be compatible with the input array.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>That&#8217;s all for now<\/strong><\/p>\n\n\n\n<p><strong>Keep Coding\u270c\u270c<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>NumPy&nbsp;is most often used to handle or work with arrays (multidimensional, masked) and matrices. It has a collection of functions and methods to operate on arrays like statistical operations, mathematical and logical operations, shape manipulation, linear algebra, and much more. Argmax function numpy.argmax()&nbsp;is one of the functions provided by NumPy that is used to&nbsp;return the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":868,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[2,52],"tags":[50,12],"class_list":["post-860","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-numpy-ml","tag-numpy","tag-python","entry","has-media"],"_links":{"self":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/comments?post=860"}],"version-history":[{"count":3,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/860\/revisions"}],"predecessor-version":[{"id":1357,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/860\/revisions\/1357"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media\/868"}],"wp:attachment":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media?parent=860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/categories?post=860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/tags?post=860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}