{"id":7284,"date":"2021-08-26T17:00:36","date_gmt":"2021-08-26T11:30:36","guid":{"rendered":"https:\/\/python-programs.com\/?p=7284"},"modified":"2021-11-22T18:39:30","modified_gmt":"2021-11-22T13:09:30","slug":"python-numpy-flatten-vs-ravel","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/","title":{"rendered":"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions"},"content":{"rendered":"

In this tutorial, python beginners and experts can easily learn about the difference between numpy ravel and flatten functions. The main aim of both numpy.ravel() and numpy.flatten() functions are the same i.e. to flatten a numpy array of any shape. Before learning about flatten ravel differences, let\u2019s take a look at the basic overview of both the numpy functions from here.<\/p>\n

numpy.ravel()<\/h2>\n

ravel() is a built-in function in the module of numpy that returns a view of the original array and also returns a flattened 1D view of the numpy array object. Moreover, it accepts an array-like element as a parameter.<\/p>\n

Syntax of the ravel() function in numpy:<\/h3>\n
numpy.ravel(a, order='C')\r\n<\/pre>\n

numpy.ndarray.flatten()<\/h2>\n

Flatten always returns a copy. The function of the flatten() is a faster member function of the numpy array where it returns a flattened 1D copy of the numpy array object.<\/p>\n

Syntax of Numpy flatten() function:<\/h3>\n
ndarray.flatten(order='C')\r\n<\/pre>\n

Let\u2019s discuss some of the differences between the numpy ravel & flatten function:<\/p>\n

Differences between ravel() & flatten()<\/strong><\/h2>\n

First of all, import the numpy module,<\/p>\n

import numpy as np<\/pre>\n

A quick view about the difference between flatten and ravel functions in numpy is furnished below:<\/p>\n

a.flatten()<\/strong><\/p>\n

(i) Return copy of the original array<\/p>\n

(ii) If you modify any value of this array value of the original array is not affected.<\/p>\n

(iii) Flatten() is comparatively slower than ravel() as it occupies memory.<\/p>\n

(iv) Flatten is a method of a ndarray object.<\/p>\n

a.ravel()<\/strong><\/p>\n

(i) Return only reference\/view of original array<\/p>\n

(ii) If you modify the array you would notice that the value of the original array also changes.<\/p>\n

(iii) Ravel is faster than flatten() as it does not occupy any memory.<\/p>\n

(iv) Ravel is a library-level function.<\/p>\n

For in-depth knowledge on the difference between flatten and ravel numpy functions, kindly check out the further sections without any fail.<\/p>\n

Difference 1: Performance: Copy vs view<\/h3>\n

Thenumpy.ndarray.flatten()<\/code>function returns a flatten copy of numpy array object only, whereas numpy.ravel() returns a flattened view of the input array if possible.<\/p>\n

\"Difference<\/p>\n

import numpy as sc\r\n# Creation of 2D Numpy array\r\narr_twoD = sc.array([[10, 20, 30],\r\n                [40, 50, 60],\r\n                [70, 85, 90]])\r\nprint('2D array')                \r\nprint(arr_twoD)\r\n# Convert the 2D array to flattened 1d view\r\nflatn_arr = arr_twoD.flatten()\r\nprint('Flattened 1D view')\r\nflatn_arr[1] = 55\r\nprint(flatn_arr)\r\nprint(arr_twoD)\r\n<\/pre>\n
Output :\r\n2D array\r\n[[10 20 30]\r\n [40 50 60]\r\n [70 85 90]]\r\nFlattened 1D view\r\n[10 55 30 40 50 60 70 85 90]\r\n[[10 20 30]\r\n [40 50 60]\r\n\u00a0[70 85 90]]<\/pre>\n

Here we can successfully change 2nd element of the numpy array that is reflected in the 1D numpy array. But the original 2D array is unaffected which denotes that flatten() returns a copy of the input array.<\/p>\n

Let’s try using numpy.ravel() to convert 2D numpy array to 1D array<\/strong><\/p>\n

ravel()<\/code> returns a flattened view of the numpy array object if possible. When there is any change done in the view object it will also get reflected in the original numpy array.<\/p>\n

\"convert<\/p>\n

import numpy as sc\r\n# Creation of 2D Numpy array\r\narr_twoD = sc.array([[10, 20, 30],\r\n                [40, 50, 60],\r\n                [70, 85, 90]])\r\nprint('2D array')                \r\nprint(arr_twoD)\r\n# Convert the 2D array to flattened 1d view\r\nflatn_arr = sc.ravel(arr_twoD)\r\nflatn_arr[1] = 55\r\nprint('Flattened 1D view:')\r\nprint(flatn_arr)\r\nprint(arr_twoD)\r\n<\/pre>\n
Output :\r\n2D array\r\n[[10 20 30]\r\n [40 50 60]\r\n [70 85 90]]\r\nFlattened 1D view:\r\n[10 55 30 40 50 60 70 85 90]\r\n[[10 55 30]\r\n [40 50 60]\r\n\u00a0[70 85 90]]<\/pre>\n

We can check of the ravel()<\/code>function returns a view object or not by using the base attribute of the returned object. If it is None<\/em> then it returns to the original numpy array i.e. it returns a flattened array which is a view only.<\/p>\n

\"using<\/p>\n

import numpy as sc\r\n# Creation of 2D Numpy array\r\narr_twoD = sc.array([[10, 20, 30],\r\n                [40, 50, 60],\r\n                [70, 85, 90]])\r\nprint('Original 2D array')                \r\nprint(arr_twoD)\r\n# Convert the 2D array to flattened 1d view\r\nflatn_arr = sc.ravel(arr_twoD)\r\nif flatn_arr.base is not None:\r\n    # Change the 2nd element of flat array\r\n    flatn_arr[1] = 55\r\n    # Modification will be reflected in 2D numpy array and flattened array\r\n    print('Flattened 1D view:')\r\n    print(flatn_arr)\r\n    print(arr_twoD)\r\n<\/pre>\n
Output :\r\nOriginal 2D array\r\n[[10 20 30]\r\n [40 50 60]\r\n [70 85 90]]\r\nFlattened 1D view:\r\n[10 55 30 40 50 60 70 85 90]\r\n[[10 55 30]\r\n [40 50 60]\r\n\u00a0[70 85 90]]<\/pre>\n

So ravel()<\/code> returns a view of the input array and hence here the performance of ravel()<\/code> is better than flatten()<\/code>.<\/p>\n

Difference 2: Compatibility with other array-like sequences (list etc)<\/h3>\n

The ndarray.flatten()<\/code>function can be used to flatten a numpy array object only. In the case of a numpy.ravel()<\/code>function being a built-in function, it accepts an array-like element, so we can even pass a list to it.<\/p>\n

\"Program<\/p>\n

import numpy as sc\r\n# Creation of list of lists\r\nlist_lists = [[10, 20,30],\r\n[40, 50, 60],\r\n[70, 85, 90]]\r\n# Creation of flattened numpy array from list of lists\r\nflatn_arr = sc.ravel(list_lists)\r\nprint('Flattened 1D Array:')\r\nprint(flatn_arr)<\/pre>\n
Output :\r\nFlattened 1D Array:\r\n[10 20 30 40 50 60 70 85 90]<\/pre>\n

While this is not feasible with ndarray.flatten() function.<\/p>\n

Conclusion on A view of the original array using numpy ravel<\/h3>\n

Therefore, to conclude in the end there are 2 main differences between the ndarray.flatten() and numpy.ravel() function,<\/p>\n

    \n
  1. ravel() function returns a view of the array if possible, where flatten() always returns a copy. Therefore the performance of ravel() is much better than flatten()<\/li>\n
  2. ravel() function can accept other array-like elements like lists etc. Although, flatten() can work with numpy arrays only.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

    In this tutorial, python beginners and experts can easily learn about the difference between numpy ravel and flatten functions. The main aim of both numpy.ravel() and numpy.flatten() functions are the same i.e. to flatten a numpy array of any shape. Before learning about flatten ravel differences, let\u2019s take a look at the basic overview of …<\/p>\n

    Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions<\/span> Read More »<\/a><\/p>\n","protected":false},"author":9,"featured_media":8081,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nPython Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions - Python Programs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions - Python Programs\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, python beginners and experts can easily learn about the difference between numpy ravel and flatten functions. The main aim of both numpy.ravel() and numpy.flatten() functions are the same i.e. to flatten a numpy array of any shape. Before learning about flatten ravel differences, let\u2019s take a look at the basic overview of … Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-26T11:30:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-22T13:09:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Satyabrata Jena\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#primaryimage\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png\",\"width\":1280,\"height\":720},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#webpage\",\"url\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/\",\"name\":\"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#primaryimage\"},\"datePublished\":\"2021-08-26T11:30:36+00:00\",\"dateModified\":\"2021-11-22T13:09:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd\"},\"headline\":\"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions\",\"datePublished\":\"2021-08-26T11:30:36+00:00\",\"dateModified\":\"2021-11-22T13:09:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#webpage\"},\"wordCount\":619,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd\",\"name\":\"Satyabrata Jena\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g\",\"caption\":\"Satyabrata Jena\"},\"url\":\"https:\/\/python-programs.com\/author\/satyabrata\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions - Python Programs","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:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/","og_locale":"en_US","og_type":"article","og_title":"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions - Python Programs","og_description":"In this tutorial, python beginners and experts can easily learn about the difference between numpy ravel and flatten functions. The main aim of both numpy.ravel() and numpy.flatten() functions are the same i.e. to flatten a numpy array of any shape. Before learning about flatten ravel differences, let\u2019s take a look at the basic overview of … Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions Read More »","og_url":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2021-08-26T11:30:36+00:00","article_modified_time":"2021-11-22T13:09:30+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Satyabrata Jena","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#primaryimage","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png","width":1280,"height":720},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#webpage","url":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/","name":"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#primaryimage"},"datePublished":"2021-08-26T11:30:36+00:00","dateModified":"2021-11-22T13:09:30+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd"},"headline":"Python Numpy: flatten() vs ravel() | Difference between the ravel numpy and flatten numpy functions","datePublished":"2021-08-26T11:30:36+00:00","dateModified":"2021-11-22T13:09:30+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#webpage"},"wordCount":619,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"image":{"@id":"https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#primaryimage"},"thumbnailUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/python-numpy-flatten-vs-ravel\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/0f6d731bda7051ce3586f71299f391cd","name":"Satyabrata Jena","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c1bf8033ec357d085f41815bee1625cc?s=96&d=mm&r=g","caption":"Satyabrata Jena"},"url":"https:\/\/python-programs.com\/author\/satyabrata\/"}]}},"jetpack_featured_media_url":"https:\/\/python-programs.com\/wp-content\/uploads\/2021\/06\/Python-Numpy-flatten-vs-ravel.png","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/7284"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=7284"}],"version-history":[{"count":5,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/7284\/revisions"}],"predecessor-version":[{"id":18946,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/7284\/revisions\/18946"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media\/8081"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=7284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=7284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=7284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}