<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mani Sai Prasad</title>
    <description>The latest articles on DEV Community by Mani Sai Prasad (@manisaiprasad).</description>
    <link>https://dev.to/manisaiprasad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F222347%2Fefb4d5dd-567f-4bc0-b2ca-39bddb3cd296.jpeg</url>
      <title>DEV Community: Mani Sai Prasad</title>
      <link>https://dev.to/manisaiprasad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manisaiprasad"/>
    <language>en</language>
    <item>
      <title>Introduction to HTTP
in a Nutshell </title>
      <dc:creator>Mani Sai Prasad</dc:creator>
      <pubDate>Fri, 18 Dec 2020 11:17:53 +0000</pubDate>
      <link>https://dev.to/manisaiprasad/introduction-to-http-in-a-nutshell-89g</link>
      <guid>https://dev.to/manisaiprasad/introduction-to-http-in-a-nutshell-89g</guid>
      <description>&lt;p&gt;Hypertext Transfer Protocol (HTTP) is a protocol that provides a standardized way for computers to communicate with each other. It has been the foundation for data communication over the internet since 1990 and is integral to understanding how client-server communication functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features of HTTP
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Connectionless&lt;/strong&gt;&lt;br&gt;
When a request is sent, the client opens the connection; once a response is received, the client closes the connection. The client and server only maintain a connection during the response and request. Future responses are made on a new connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stateless&lt;/strong&gt; &lt;br&gt;
There is no dependency between successive requests. Each request is an individual request&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not Sessionless&lt;/strong&gt; &lt;br&gt;
Utilizing headers and cookies, sessions can be created to allow each HTTP request to share the same context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Media Independent:&lt;/strong&gt; &lt;br&gt;
Any type of data can be sent over HTTP as long as both the client and server know how to handle the data format. In our case, we'll use JSON.&lt;/p&gt;

&lt;h2&gt;
  
  
  Elements:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Universal Resource Identifiers (URIs):&lt;/strong&gt; &lt;br&gt;
An example URI is &lt;a href="https://github.com/manisaiprasad?tab=repositories"&gt;https://github.com/manisaiprasad?tab=repositories&lt;/a&gt; It has certain components:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scheme:&lt;/strong&gt;&lt;br&gt;
specifies the protocol used to access the resource, HTTP or HTTPS. In our example HTTPS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Host:&lt;/strong&gt;&lt;br&gt;
 specifies the host that holds the resources. In our example github.com.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Path:&lt;/strong&gt;&lt;br&gt;
 specifies the specific resource being requested. In our example, /manisaiprasad.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query:&lt;/strong&gt;&lt;br&gt;
an optional component, the query string provides information the resource can use for some purpose such as a search parameter. In our example, tab=repositories.&lt;/p&gt;

&lt;h1&gt;
  
  
  HTTP Requests
&lt;/h1&gt;

&lt;p&gt;HTTP requests are sent from the client to the server to initiate some operation. In addition to the URL, HTTP requests have other elements to specify the requested resource.&lt;/p&gt;

&lt;h2&gt;
  
  
  Elements of HTTP Requests:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt; Defines the operation to be performed&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Path:&lt;/strong&gt; The URL of the resource to be fetched, excluding the scheme and host&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP Version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Headers:&lt;/strong&gt; &lt;br&gt;
optional information, success as Accept-Language&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Body:&lt;/strong&gt; optional information, usually for methods such as POST and PATCH, which contain the resource being sent to the server&lt;/p&gt;

&lt;h2&gt;
  
  
  Request Methods
&lt;/h2&gt;

&lt;p&gt;Different request methods indicate different operations to be performed. It's essential to attend to this to correctly format your requests and properly structure an API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GET:&lt;/strong&gt; ONLY retrieves information for the requested resource of the given URI&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;POST:&lt;/strong&gt;  Send data to the server to create a new resource.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PUT:&lt;/strong&gt; Replaces all of the representation of the target resource with the requested data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PATCH&lt;/strong&gt;: Partially modifies the representation of the target resource with the requested data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DELETE&lt;/strong&gt;: Removes all of the representation of the resource specified by the URI&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OPTIONS&lt;/strong&gt;: Sends the communication options for the requested resource&lt;/p&gt;

&lt;h1&gt;
  
  
  HTTP Responses
&lt;/h1&gt;

&lt;p&gt;After the request has been received by the server and processed, the server returns an HTTP response message to the client. The response informs the client of the outcome of the requested operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Elements of HTTP Responses:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Status Code &amp;amp; Status Message&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP Version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Headers:&lt;/strong&gt; similar to the request headers, provides information about the response and resource representation. Some common headers include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Content-Type:&lt;/strong&gt; the media type of the body of the request&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Body:&lt;/strong&gt; optional data containing the requested resource&lt;/p&gt;

&lt;h3&gt;
  
  
  Status Codes:
&lt;/h3&gt;

&lt;p&gt;As an API developer, it's important to send the correct status code. As a developer using an API, the status codes—particularly the error codes—are important for understanding what caused an error and how to proceed.&lt;/p&gt;

&lt;h4&gt;
  
  
  Codes fall into five categories:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1xx&lt;/strong&gt; Informational (100's)&lt;br&gt;
&lt;strong&gt;2xx&lt;/strong&gt; Success (200's)&lt;br&gt;
&lt;strong&gt;3xx&lt;/strong&gt; Redirection (300's)&lt;br&gt;
&lt;strong&gt;4xx&lt;/strong&gt; Client Error (400's)&lt;br&gt;
&lt;strong&gt;5xx&lt;/strong&gt; Server Error (500's)&lt;/p&gt;

&lt;h4&gt;
  
  
  Common Codes:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;200&lt;/strong&gt;: OK&lt;br&gt;
&lt;strong&gt;201:&lt;/strong&gt; Created&lt;br&gt;
&lt;strong&gt;304:&lt;/strong&gt; Not Modified&lt;br&gt;
&lt;strong&gt;400:&lt;/strong&gt; Bad Request&lt;br&gt;
&lt;strong&gt;401:&lt;/strong&gt; Unauthorized&lt;br&gt;
&lt;strong&gt;404:&lt;/strong&gt; Not Found&lt;br&gt;
&lt;strong&gt;405:&lt;/strong&gt; Method Not Allowed&lt;br&gt;
&lt;strong&gt;500:&lt;/strong&gt; Internal Server Error&lt;/p&gt;

</description>
      <category>http</category>
      <category>webdev</category>
      <category>html</category>
      <category>inthirtyseconds</category>
    </item>
    <item>
      <title>Ghost on Heroku</title>
      <dc:creator>Mani Sai Prasad</dc:creator>
      <pubDate>Wed, 19 Aug 2020 01:00:02 +0000</pubDate>
      <link>https://dev.to/manisaiprasad/ghost-on-heroku-24eg</link>
      <guid>https://dev.to/manisaiprasad/ghost-on-heroku-24eg</guid>
      <description>&lt;p&gt;Ghost is a free and open-source blogging platform written in JavaScript and distributed under the MIT License, It a simple and a powerful platform to share your content&lt;/p&gt;

&lt;p&gt;Visit the project's website at &lt;a href="http://ghost.org"&gt;http://ghost.org&lt;/a&gt;, or read the docs on &lt;a href="http://support.ghost.org"&gt;http://support.ghost.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We all know  &lt;a href="http://heroku.com"&gt;Heroku&lt;/a&gt; is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud and most of it for free&lt;/p&gt;

&lt;p&gt;So it's a good idea to maintain your Ghost powered blog for free on Heroku&lt;/p&gt;

&lt;p&gt;To get started head over to my Github project &lt;a href="https://github.com/manisaiprasad/ghostonheroku/"&gt;ghostonheroku&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then simply click on 'Deploy to Heroku button'&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--26lElwvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.herokucdn.com/deploy/button.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--26lElwvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.herokucdn.com/deploy/button.svg" alt="Deploy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you will be redirected to the Heroku website to create a New App&lt;br&gt;&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--itkjtpXg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vva34e9rjzu6553mwdse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--itkjtpXg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vva34e9rjzu6553mwdse.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we are using JawsDB MySQL and Mailgun as addons don't worry both are free addons and then click deploy &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pc6zZ24D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9ao1h6hykcuxsh5k0i18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pc6zZ24D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9ao1h6hykcuxsh5k0i18.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will take some time to configure the environment and build the app&lt;br&gt;
After its deployed to Heroku, open the app &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7a26GEjr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7qx2fno1fbx2m5tedw46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7a26GEjr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7qx2fno1fbx2m5tedw46.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Congratulation 🎉 you have deployed your blog app to Heroku!
&lt;/h1&gt;

&lt;p&gt;After deployment,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, visit Ghost at &lt;a href="https://YOURAPPNAME.herokuapp.com/ghost"&gt;https://YOURAPPNAME.herokuapp.com/ghost&lt;/a&gt; to set up your admin account&lt;/li&gt;
&lt;li&gt;The app may take a few minutes to come to life&lt;/li&gt;
&lt;li&gt;Your blog will be publicly accessible at &lt;a href="https://YOURAPPNAME.herokuapp.com"&gt;https://YOURAPPNAME.herokuapp.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you subsequently set up a custom domain for your blog, you’ll need to update your Ghost blog’s PUBLIC_URL environment variable accordingly, heroku config:set PUBLIC_URL=&lt;a href="https://www.example.com"&gt;https://www.example.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more in-depth tech details Check out the project Readme on Github &lt;a href="https://github.com/manisaiprasad/ghostonheroku"&gt;https://github.com/manisaiprasad/ghostonheroku&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Thank you!   Happy Blogging 🎉
&lt;/h1&gt;

&lt;p&gt;Comment down our views and if any issues &lt;/p&gt;

</description>
      <category>writing</category>
      <category>opensource</category>
      <category>database</category>
    </item>
    <item>
      <title>Developer analysis of programming languages used in the United States 2020

</title>
      <dc:creator>Mani Sai Prasad</dc:creator>
      <pubDate>Mon, 03 Aug 2020 21:54:15 +0000</pubDate>
      <link>https://dev.to/manisaiprasad/developer-analysis-of-programming-languages-used-in-the-united-states-2020-p8j</link>
      <guid>https://dev.to/manisaiprasad/developer-analysis-of-programming-languages-used-in-the-united-states-2020-p8j</guid>
      <description>&lt;p&gt;Hello, fellow developers here are some analysis of programming languages used in the United States as per 2020 based on the Stackoverflow’s 2020 Annual Developer Survey.&lt;/p&gt;

&lt;p&gt;Let's dig into the analysis&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are the most common programming languages in the United States?&lt;/li&gt;
&lt;li&gt;Demanding programming languages in the United States?&lt;/li&gt;
&lt;li&gt;What are the most popular roles in the United States?&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  What are the most used programming languages in the United States?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3XFENp6S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2a5l1r8311oj1v2zo1wh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3XFENp6S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2a5l1r8311oj1v2zo1wh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that languages like JavaScript, HTML/CSS, SQL, and Python are still in the top positions.&lt;/p&gt;

&lt;p&gt;We can see that in 2020 python has risen a lot compared to other languages in the survey&lt;/p&gt;

&lt;h1&gt;
  
  
  Demanding programming languages in the United States?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PxF6fn3I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/veazr9inu0kpn21dhaw7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PxF6fn3I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/veazr9inu0kpn21dhaw7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that Python has grown tremendously rather then other languages. This is probably happening because it’s a programming language that is very versatile and has been used extensively in data-related areas.&lt;/p&gt;

&lt;p&gt;Because now we are seeing more interest in machine learning and data science&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the most popular roles in the United States?
&lt;/h1&gt;

&lt;p&gt;We can see that Full Stack developer is the most popular role among the United States.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1gTDJF4P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dhp1kp7u5eq6jzdlbg8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1gTDJF4P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dhp1kp7u5eq6jzdlbg8p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Back-end developer, Front end developer is the most popular occupation among participants after 2020.&lt;/p&gt;

&lt;p&gt;The mobile developer is the popular role among participants in 2019, whereas in 2020 its trend is slowing down.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this article, we took a look at what were the most popular programming languages, according to Stackoverflow’s 2019 and 2020 Developer Survey data.&lt;/p&gt;

&lt;p&gt;We have seen that programming languages like as JavaScript, SQL, and Python still dominates the industry&lt;/p&gt;

&lt;p&gt;And we can see that Python has grown tremendously rather then other languages. This is probably happening because it’s a programming language that is very versatile and has been used extensively in data-related areas.&lt;/p&gt;

&lt;p&gt;Back-end developer, Full-stack web developer, Front end developer is the most popular role among participants after 2020.&lt;/p&gt;

&lt;p&gt;To see more about this analysis, see the link to GitHub repo here&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/manisaiprasad/Dev-analysis-sof-2020"&gt;https://github.com/manisaiprasad/Dev-analysis-sof-2020&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;p&gt;Stackoverflow Developer Survey Data: &lt;a href="https://insights.stackoverflow.com/survey"&gt;https://insights.stackoverflow.com/survey&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>sql</category>
      <category>bash</category>
    </item>
    <item>
      <title>Data in NumPy</title>
      <dc:creator>Mani Sai Prasad</dc:creator>
      <pubDate>Wed, 20 May 2020 07:05:42 +0000</pubDate>
      <link>https://dev.to/manisaiprasad/data-in-numpy-afe</link>
      <guid>https://dev.to/manisaiprasad/data-in-numpy-afe</guid>
      <description>&lt;p&gt;Python is excellent, but some times it can be slow. Happily, it allows us to access libraries that can execute faster code which is written in languages like C. NumPy is one such library: which provides fast alternatives to math operations in Python and is designed to work efficiently with groups of numbers - like tensors&lt;/p&gt;

&lt;h2&gt;
  
  
  Importing NumPy
&lt;/h2&gt;

&lt;p&gt;When importing the NumPy library, the convention most often used is np&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import numpy as np&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Types and Shapes
&lt;/h2&gt;

&lt;p&gt;The most common way to work with numbers in NumPy is through ndarray objects. Kind of Similar to Python lists, but can have any number of dimensions. Also, ndarray supports fast math operations, which we want.&lt;br&gt;
Since it can store any number of dimensions, we can use ndarrays to represent any of the data types like &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scalars &lt;/li&gt;
&lt;li&gt;vectors &lt;/li&gt;
&lt;li&gt;matrices &lt;/li&gt;
&lt;li&gt;or tensors&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Scalars
&lt;/h3&gt;

&lt;p&gt;Scalar is simply a quantity described by a single element&lt;/p&gt;

&lt;p&gt;In NumPy, we can specify signed and unsigned types, as well as different sizes. Instead of Python’s types like uint8, int8, uint16 and so on..&lt;/p&gt;

&lt;p&gt;These types of objects we make (vectors, matrices, tensors) eventually store scalars. And when we create a NumPy array, we can specify the type - but every item in the array must have the same type. &lt;/p&gt;

&lt;p&gt;NumPy arrays are more like C arrays than Python lists.&lt;br&gt;
We can create a NumPy array that holds a scalar by passing the value to NumPy's array function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s = np.array(5)
s.shape
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;out: ()&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;() means it has zero dimensions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = s + 3
x
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;out: 8&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Vectors
&lt;/h3&gt;

&lt;p&gt;Vector is simply like an array with one dimension, consist of one or more scalars&lt;/p&gt;

&lt;p&gt;We can create a vector, by passing a Python list to the array function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v = np.array([1,2,3])
v.shape
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;out: (3,)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(3,) means it has one dimension.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = v[1]
x
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;out: 2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We simply index to get a value &lt;/p&gt;

&lt;h3&gt;
  
  
  Matrices
&lt;/h3&gt;

&lt;p&gt;We create matrices using NumPy's array function, as just we did for vectors. However, instead of just passing a list, we need to supply a list of lists, where each list represents a row. So to create a 3x3 matrix containing the numbers one through nine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;m = np.array([[1,2,3], [4,5,6], [7,8,9]])
m
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;array([[1, 2, 3],&lt;br&gt;
             [4, 5, 6],&lt;br&gt;
                [7, 8, 9]])&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;m.shape&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;which return (3, 3), it represent two dimensions&lt;/p&gt;

&lt;h3&gt;
  
  
  Tensors
&lt;/h3&gt;

&lt;p&gt;Tensors are just like vectors and matrices, but they can have more dimensions, like n dimensions&lt;br&gt;
  For example, to create a 3x3x2x1 tensor you could do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;t = np.array([[[[1],[2]],[[3],[4]],[[5],[6]]],[[[7],[8]],\
    [[9],[10]],[[11],[12]]],[[[13],[14]],[[15],[16]],[[17],[17]]]])
t
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;it's like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array([[[[ 1],
         [ 2]],

        [[ 3],
         [ 4]],

        [[ 5],
         [ 6]]],


       [[[ 7],
         [ 8]],

        [[ 9],
         [10]],

        [[11],
         [12]]],


       [[[13],
         [14]],

        [[15],
         [16]],

        [[17],
         [17]]]])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;with a shape of (3, 3, 2, 1)&lt;/p&gt;

&lt;h2&gt;
  
  
  Changing Shapes
&lt;/h2&gt;

&lt;p&gt;Sometimes we need to change the shape of the data without actually changing its contents. For example, you may have a vector, which is one-dimensional but need a matrix, which is two-dimensional. So, here we can reshape it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v = np.array([1,2,3,4])
v.shape

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;(4,)&lt;br&gt;
its a vector&lt;br&gt;
so here we can reshape by following:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = v.reshape(1,4)
x.shape
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;(1, 4)&lt;br&gt;
which is a matric we wanted &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you see code from experienced NumPy users, you will often see them use a special slicing syntax instead of calling reshape. Using this syntax, the previous examples would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = v[None, :]
x
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;array([[1, 2, 3, 4]])&lt;/p&gt;

&lt;h2&gt;
  
  
  Element-wise operations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  lets see how we can do with Python
&lt;/h3&gt;

&lt;p&gt;Suppose we had a list of numbers, and you wanted to add 5 to every item in the list. Without NumPy, you might do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;values = [1,2,3,4,5]
for i in range(len(values)):
    values[i] += 5
values
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;[6, 7, 8, 9, 10]&lt;/p&gt;

&lt;p&gt;we can say its not that great&lt;/p&gt;

&lt;h3&gt;
  
  
  Lets see the NumPy way
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;values = [1,2,3,4,5]
values = np.array(values) + 5
values
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;array([ 6,  7,  8,  9, 10])&lt;/p&gt;

&lt;p&gt;Creating that array may seem odd, but normally you'll be storing your data in ndarrays anyway. So if you already had an ndarray named values, you could have just done:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;values += 5
values
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;array([11, 12, 13, 14, 15])&lt;/p&gt;

&lt;p&gt;NumPy actually has functions for things like adding, multiplying, etc. But it also supports using the standard math operators. So the following two lines are equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = np.multiply(values, 5)
x = values * 5
x
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;array([55, 60, 65, 70, 75])&lt;/p&gt;

&lt;h2&gt;
  
  
  Matrix Multiplication
&lt;/h2&gt;

&lt;h3&gt;
  
  
  NumPy Element-wise Matrix Multiplication
&lt;/h3&gt;

&lt;p&gt;NumPy supports several types of matrix multiplication.&lt;br&gt;
Element-wise Multiplication&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;m = np.array([[1,2,3],[4,5,6]])
n = m * 0.25
n
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array([[0.25, 0.5 , 0.75],
       [1.  , 1.25, 1.5 ]])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;np.multiply(m, n)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array([[0.25, 1.  , 2.25],
       [4.  , 6.25, 9.  ]])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Matrix Product
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The number of columns in the left matrix must equal the number of rows in the right matrix.&lt;/li&gt;
&lt;li&gt;The answer matrix always has the same number of rows as the left matrix and the same number of columns as the right matrix.&lt;/li&gt;
&lt;li&gt;Order matters. Multiplying A•B is not the same as multiplying B•A.&lt;/li&gt;
&lt;li&gt;Data in the left matrix should be arranged as rows., while data in the right matrix should be arranged as columns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To find the matrix product, we use NumPy's matmul function.&lt;/p&gt;

&lt;p&gt;If you have compatible shapes, then it's as simple as this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = np.array([[1,2,3,4],[5,6,7,8]])
a.shape
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;(2, 4)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b = np.array([[1,2,3],[4,5,6],[7,8,9],[10,11,12]])
b.shape
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;(4, 3)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c = np.matmul(a, b)
c
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array([[ 70,  80,  90],
       [158, 184, 210]])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If your matrices have incompatible shapes, you'll get an error, like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;np.matmul(b, a)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&amp;lt;ipython-input-67-af3b88aa2232&amp;gt; in &amp;lt;module&amp;gt;
----&amp;gt; 1 np.matmul(b, a)

ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)-&amp;gt;(n?,m?) (size 2 is different from 3)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  NumPy's dot function
&lt;/h3&gt;

&lt;p&gt;You may sometimes see NumPy's dot function in places where you would expect a matmul. It turns out that the results of dot and matmul are the same if the matrices are two dimensional.&lt;br&gt;
So these two results are equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = np.array([[1,2],[3,4]])
np.dot(a,a)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array([[ 7, 10],
       [15, 22]])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;np.matmul(a,a)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array([[ 7, 10],
       [15, 22]])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;While these functions return the same results for two-dimensional data, you should be careful about which you choose when working with other data shapes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Play here
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://drive.google.com/file/d/1UfzBi3B5-OJLAsxuX-SnTuQ_lyqmyiKk/view?usp=sharing"&gt;Link to an interactive colab notebook&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Thank you :)
&lt;/h1&gt;

</description>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>functional</category>
    </item>
  </channel>
</rss>
