{"id":79461,"date":"2020-07-21T13:35:00","date_gmt":"2020-07-21T08:05:00","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=79461"},"modified":"2020-07-21T13:35:00","modified_gmt":"2020-07-21T08:05:00","slug":"python-numpy-tutorial","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/","title":{"rendered":"Python NumPy Tutorial for Data Science"},"content":{"rendered":"<p>In this NumPy Tutorial, we will learn what is <strong>NumPy<\/strong>. We will learn about its <strong>uses<\/strong>, <strong>installation<\/strong>, <strong>operations<\/strong> and many other features.<\/p>\n<p>So let&#8217;s start!!!<\/p>\n<h3>NumPy Introduction<\/h3>\n<p>NumPy stands for <strong>\u2018Numerical Python\u2019<\/strong>. It is a <strong>package<\/strong> in Python to work with <strong>arrays<\/strong>. It is a <strong>basic scientific library<\/strong>. Its most important feature is the<strong> n-dimensional array object<\/strong>. It has uses in <strong>statistical functions<\/strong>, <strong>linear algebra<\/strong>, <strong>arithmetic operations<\/strong>, <strong>bitwise operations<\/strong>, etc.<\/p>\n<p>We perform all the <strong>operations<\/strong> on the<strong> array elements<\/strong>. We can <strong>initialize<\/strong> these <strong>arrays<\/strong> in several ways.<\/p>\n<h3>Prerequisite to Learn NumPy<\/h3>\n<p>The <strong>two basic prerequisites<\/strong> for NumPy are <strong>Python<\/strong> and <strong>Mathematics<\/strong>. We need to know the <strong>python basics<\/strong> to work with the <strong>NumPy module<\/strong>.<\/p>\n<p>The functions available in <strong>NumPy<\/strong> are <strong>built<\/strong> on <strong>python language<\/strong>. We can hence combine the knowledge of <strong>python arrays<\/strong> and <strong>list<\/strong> for <strong>array initialization<\/strong> and <strong>operations<\/strong>.<\/p>\n<h3>NumPy Installation<\/h3>\n<p>We can install Python NumPy by going to the <strong>command prompt<\/strong> and <strong>typing<\/strong> a <strong>simple command<\/strong> <strong>pip<\/strong> <strong>install NumPy<\/strong>. Then go to the <strong>IDE<\/strong> and use the <strong>import command import NumPy<\/strong> as <strong>np<\/strong>.<\/p>\n<p>We can now <strong>access<\/strong> all the <strong>functionalities<\/strong> of the <strong>NumPy module<\/strong>.<\/p>\n<h3>Uses of NumPy<\/h3>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/07\/Uses-of-NumPy-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79484\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/07\/Uses-of-NumPy-1.jpg\" alt=\"Uses of NumPy\" width=\"828\" height=\"584\" \/><\/a><\/p>\n<p>NumPy is one of the most useful <strong>external libraries<\/strong> available in Python. It has a wide variety of <strong>functions<\/strong> to work with <strong>arrays<\/strong> and a <strong>powerful multi-dimensional array object<\/strong>. It has <strong>operations<\/strong> that are <strong>applicable<\/strong> to a <strong>vast range<\/strong> of <strong>platforms<\/strong>.<\/p>\n<p>Numpy can be put to use for <strong>storing<\/strong>, <strong>manipulation<\/strong>, and <strong>deletion<\/strong> of <strong>array elements<\/strong>. We can use it for <strong>sorting<\/strong>, <strong>indexing<\/strong>, and <strong>stacking<\/strong> of the <strong>array elements<\/strong>. It has modules regarding various operations:<\/p>\n<ul>\n<li>Arithmetic operations<\/li>\n<li>Statistical Operations<\/li>\n<li>Bitwise Operators<\/li>\n<li>Linear Algebra<\/li>\n<li>Copying and viewing arrays<\/li>\n<li>Stacking<\/li>\n<li>Searching, Sorting, and counting, etc.<\/li>\n<li>Mathematical Operations<\/li>\n<li>Broadcasting<\/li>\n<li>Matplotlib for graphical representations<\/li>\n<li>Matrix Operations, etc.<\/li>\n<\/ul>\n<h3>NumPy vs. Python arrays<\/h3>\n<p>The <strong>NumPy library<\/strong> is a great <strong>alternative<\/strong> to <strong>python arrays<\/strong>. The difference is that the NumPy arrays are <strong>homogeneous<\/strong> that makes it <strong>easier<\/strong> to work with. We can <strong>initialize<\/strong> the <strong>array elements<\/strong> in many ways, one being which is through the <strong>python lists<\/strong>.<\/p>\n<p>The NumPy arrays are convenient as they have the following <strong>three features<\/strong>&#8211;<\/p>\n<ul>\n<li><strong>Less Memory Requirement<\/strong><\/li>\n<li><strong>Faster Processing<\/strong><\/li>\n<li><strong>Convenience of use<\/strong><\/li>\n<\/ul>\n<h3>Data types in NumPy<\/h3>\n<p>Numpy <strong>supports<\/strong> <strong>more data types<\/strong> as compared to Python. These data types are instances of <strong>dtype objects<\/strong>. Some of the <strong>scalar data<\/strong> <strong>types<\/strong> are given in the table below.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Sr.No.<\/strong><\/td>\n<td><strong>Data Types<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1.<\/span><\/td>\n<td><span style=\"font-weight: 400\">bool_<\/span><\/td>\n<td><span style=\"font-weight: 400\">Boolean True\/False<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2.<\/span><\/td>\n<td><span style=\"font-weight: 400\">int_<\/span><\/td>\n<td><span style=\"font-weight: 400\">Integer type<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">3.<\/span><\/td>\n<td><span style=\"font-weight: 400\">intc<\/span><\/td>\n<td><span style=\"font-weight: 400\">Same as C int<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4.<\/span><\/td>\n<td><span style=\"font-weight: 400\">intp<\/span><\/td>\n<td><span style=\"font-weight: 400\">An integer used for indexing<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">5.<\/span><\/td>\n<td><span style=\"font-weight: 400\">int8<\/span><\/td>\n<td><span style=\"font-weight: 400\">Byte(-128 to 127)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">6.<\/span><\/td>\n<td><span style=\"font-weight: 400\">int16<\/span><\/td>\n<td><span style=\"font-weight: 400\">Integer(-32768 to 32767)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">7.<\/span><\/td>\n<td><span style=\"font-weight: 400\">int32<\/span><\/td>\n<td><span style=\"font-weight: 400\">Integer(-2147483648 to 2147483647)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">8.<\/span><\/td>\n<td><span style=\"font-weight: 400\">int64<\/span><\/td>\n<td><span style=\"font-weight: 400\">Integer (-9223372036854775808 to 9223372036854775807)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">9.<\/span><\/td>\n<td><span style=\"font-weight: 400\">uint8<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned integer(0 to 225)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">10.<\/span><\/td>\n<td><span style=\"font-weight: 400\">unit16<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned integer(0 to 65535)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">11.<\/span><\/td>\n<td><span style=\"font-weight: 400\">unit32<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned Integer(0 to 4294967295)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">12.<\/span><\/td>\n<td><span style=\"font-weight: 400\">unit64<\/span><\/td>\n<td><span style=\"font-weight: 400\">Unsigned Integer(0 to 18446744073709551615)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">13.<\/span><\/td>\n<td><span style=\"font-weight: 400\">float_<\/span><\/td>\n<td><span style=\"font-weight: 400\">Shorthand for float64<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">14.<\/span><\/td>\n<td><span style=\"font-weight: 400\">float16<\/span><\/td>\n<td><span style=\"font-weight: 400\">Half precision float<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">15.<\/span><\/td>\n<td><span style=\"font-weight: 400\">float32<\/span><\/td>\n<td><span style=\"font-weight: 400\">Single precision float<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">16.<\/span><\/td>\n<td><span style=\"font-weight: 400\">float64<\/span><\/td>\n<td><span style=\"font-weight: 400\">Double precision float<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">17.<\/span><\/td>\n<td><span style=\"font-weight: 400\">complex_<\/span><\/td>\n<td><span style=\"font-weight: 400\">Shorthand for comples128<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">18.<\/span><\/td>\n<td><span style=\"font-weight: 400\">complex64<\/span><\/td>\n<td><span style=\"font-weight: 400\">Two 32bit float complex number<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">19.<\/span><\/td>\n<td><span style=\"font-weight: 400\">complex128<\/span><\/td>\n<td><span style=\"font-weight: 400\">Two 64 bit float complex number<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>NumPy Operations<\/h3>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/07\/NumPy-Operations-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79485\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/07\/NumPy-Operations-1.jpg\" alt=\"NumPy Operations\" width=\"652\" height=\"514\" \/><\/a><\/p>\n<p>NumPy consists of a <strong>wide range of functions<\/strong> to work with <strong>arrays<\/strong>.<\/p>\n<h4>1. Numpy ndim<\/h4>\n<p>It is the <strong>function<\/strong> which <strong>determines<\/strong> the <strong>dimensions<\/strong> of the <strong>input array<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na = np.array([(1,1,1),(2,2,2)])\nprint(a.ndim)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">2<\/div>\n<h4>2. Numpy itemsize()<\/h4>\n<p>We use this function to determine the <strong>size of <\/strong>the <strong>array elements<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na = np.array([(1,1)])\nprint(a.itemsize)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">8<\/div>\n<h4>3. Numpy dtype()<\/h4>\n<p>We use this function to determine the <strong>data type<\/strong> of the <strong>array elements<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na = np.array([(1,1)])\nprint(a.dtype)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">int64<\/div>\n<h4>4. Numpy reshape()<\/h4>\n<p>We use this function to <strong>reassign<\/strong> the <strong>array<\/strong> a <strong>new shape<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na = np.array([(1,1,1),(2,2,2)])\nprint(a)\na=a.reshape(3,2)\nprint(a)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[[1 1 1]<br \/>\n[2 2 2]]<br \/>\n[[1 1]<br \/>\n[1 2]<br \/>\n[2 2]]<\/div>\n<h4>5. Numpy slicing()<\/h4>\n<p>It is for <strong>extracting<\/strong> a <strong>particular set<\/strong> of <strong>elements<\/strong> from the <strong>array<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na=np.array([(1,1),(2,2),(3,3)])\nprint(a[0:2,1])\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[1 2]<\/div>\n<h4>6. Numpy linspace()<\/h4>\n<p>This is for array generation of <strong>evenly spread elements<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na=np.linspace(1,5,10)\nprint(a)<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[1. 1.44444444 1.88888889 2.33333333 2.77777778 3.22222222<br \/>\n3.66666667 4.11111111 4.55555556 5. ]<\/div>\n<h4>7. Numpy min() \/ Numpy max()<\/h4>\n<p>We can find the <strong>minimum<\/strong> and <strong>maximum<\/strong> <strong>values<\/strong> from the <strong>array<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\n \narr= np.array([10,20,30])\nprint(arr.min())\nprint(arr.max())\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">10<br \/>\n30<\/div>\n<h4>8. Numpy sum()<\/h4>\n<p>This is to <strong>return<\/strong> the <strong>sum<\/strong> of all the <strong>array elements<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\n \narr= np.array([10,50,100])\nprint(arr.sum())\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">160<\/div>\n<h4>9. Numpy sqrt()\/ Numpy std()<\/h4>\n<p>We can determine the <strong>square root<\/strong> and <strong>standard deviation<\/strong> of the <strong>array elements<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\na=np.array([(1,2,3),(4,5,6)])\nprint(np.sqrt(a))\nprint(np.std(a))\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[[1. 1.41421356 1.73205081]<br \/>\n[2. 2.23606798 2.44948974]]<br \/>\n1.707825127659933<\/div>\n<h4>10. +,-,\/, *<\/h4>\n<p>We can determine the <strong>sum<\/strong>, <strong>difference<\/strong>, <strong>division<\/strong>, and <strong>multiplication<\/strong> of the <strong>array elements<\/strong> with the use of these <strong>operators<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\nx= np.array([(1,1,1),(2,2,2)])\ny= np.array([(3,3,3),(4,4,4)])\nprint(x+y)\nprint(x-y)\nprint(x*y)\nprint(x\/y)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[[4 4 4]<br \/>\n[6 6 6]]<br \/>\n[[-2 -2 -2]<br \/>\n[-2 -2 -2]]<br \/>\n[[3 3 3]<br \/>\n[8 8 8]]<br \/>\n[[0.33333333 0.33333333 0.33333333]<br \/>\n[0.5 0.5 0.5 ]]<\/div>\n<h4>11. Numpy hstack\/ Numpy vstack()<\/h4>\n<p>These are <strong>stacking functions<\/strong>, we can perform <strong>horizontal<\/strong> and <strong>vertical<\/strong> <strong>stacking<\/strong> of <strong>arrays<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\nx= np.array([(1,1,1),(2,2,2)])\ny= np.array([(3,3,3),(4,4,4)])\nprint(np.vstack((x,y)))\nprint(np.hstack((x,y)))\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[[1 1 1]<br \/>\n[2 2 2]<br \/>\n[3 3 3]<br \/>\n[4 4 4]]<br \/>\n[[1 1 1 3 3 3]<br \/>\n[2 2 2 4 4 4]]<\/div>\n<h4>12. Numpy ravel()<\/h4>\n<p>This function concerts the <strong>entire array<\/strong> into a <strong>single column<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\narr= np.array([(1,1,1),(2,2,2)])\nprint(arr.ravel())\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">[1 1 1 2 2 2]<\/div>\n<p>There are a <strong>few special functions<\/strong> available in <strong>NumPy<\/strong>. We can plot the <strong>sine<\/strong>, <strong>cos,<\/strong> and <strong>tan curves<\/strong> using the <strong>matplotlib module. <\/strong>It is an <strong>alternative<\/strong> to other <strong>plotting software<\/strong> like <strong>MatLab<\/strong>.<\/p>\n<p>It is a great alternative when working with <strong>graphical representations<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np\nimport matplotlib.pyplot as plt\narr1= np.arange(0,2*np.pi,0.5)\narr2=np.sin(arr1)\narr3=np.cos(arr1)\narr4=np.tan(arr1)\nplt.plot(arr1,arr2)\nplt.plot(arr1,arr3)\nplt.plot(arr1,arr4)\nplt.show()\n<\/pre>\n<h3>Summary<\/h3>\n<p>Here we come to the end of <strong>Numpy Tutorial<\/strong>.<\/p>\n<p>NumPy is the <strong>basic library<\/strong> for <strong>mathematical operations<\/strong> in <strong>Machine Learning<\/strong>. It has a <strong>vast range of functions<\/strong> to <strong>manipulate arrays<\/strong> and <strong>matrices<\/strong>. It is a very <strong>convenient<\/strong> and <strong>user-friendly library<\/strong>. It has made to work with an <strong>array element<\/strong> a much easier task.<\/p>\n<p>Working with arrays has turned out to be a much <strong>faster<\/strong> and <strong>time-efficient process<\/strong>. It is very easy to <strong>install<\/strong> and <strong>implement<\/strong>.<\/p>\n<p>There are many <strong>modules<\/strong> in <strong>NumPy<\/strong> that are specific to <strong>various complex functions<\/strong>. It can also <strong>extend functionalities<\/strong> by <strong>combining<\/strong> with <strong>other python libraries<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this NumPy Tutorial, we will learn what is NumPy. We will learn about its uses, installation, operations and many other features. So let&#8217;s start!!! NumPy Introduction NumPy stands for \u2018Numerical Python\u2019. It is&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":79483,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[3050,3051,3052,3053],"class_list":["post-79461","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-numpy-installation","tag-numpy-operations","tag-numpy-uses","tag-python-numpy-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python NumPy Tutorial for Data Science - TechVidvan<\/title>\n<meta name=\"description\" content=\"Numpy tutorial - Learn what is numpy, uses of numpy, numpy installation, numpy vs python arrays, numpy operations ndim, ravel, hstack, vstack, min, max, etc\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python NumPy Tutorial for Data Science - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Numpy tutorial - Learn what is numpy, uses of numpy, numpy installation, numpy vs python arrays, numpy operations ndim, ravel, hstack, vstack, min, max, etc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-21T08:05:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/NumPy-tutorial-for-beginners-1.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=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python NumPy Tutorial for Data Science - TechVidvan","description":"Numpy tutorial - Learn what is numpy, uses of numpy, numpy installation, numpy vs python arrays, numpy operations ndim, ravel, hstack, vstack, min, max, etc","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:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Python NumPy Tutorial for Data Science - TechVidvan","og_description":"Numpy tutorial - Learn what is numpy, uses of numpy, numpy installation, numpy vs python arrays, numpy operations ndim, ravel, hstack, vstack, min, max, etc","og_url":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-07-21T08:05:00+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/NumPy-tutorial-for-beginners-1.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Python NumPy Tutorial for Data Science","datePublished":"2020-07-21T08:05:00+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/"},"wordCount":835,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/NumPy-tutorial-for-beginners-1.jpg","keywords":["numpy installation","numpy operations","numpy uses","Python NumPy Tutorial"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/","url":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/","name":"Python NumPy Tutorial for Data Science - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/NumPy-tutorial-for-beginners-1.jpg","datePublished":"2020-07-21T08:05:00+00:00","description":"Numpy tutorial - Learn what is numpy, uses of numpy, numpy installation, numpy vs python arrays, numpy operations ndim, ravel, hstack, vstack, min, max, etc","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/NumPy-tutorial-for-beginners-1.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/NumPy-tutorial-for-beginners-1.jpg","width":1200,"height":628,"caption":"NumPy tutorial for beginners (1)"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/python-numpy-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Python NumPy Tutorial for Data Science"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=79461"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79461\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/79483"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=79461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=79461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=79461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}