├── README.md
└── Array.ipynb
/README.md:
--------------------------------------------------------------------------------
1 | # Introduction-to-Numpy
--------------------------------------------------------------------------------
/Array.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "nbformat": 4,
3 | "nbformat_minor": 0,
4 | "metadata": {
5 | "colab": {
6 | "provenance": [],
7 | "authorship_tag": "ABX9TyO1ttu/91GTNi4WRRSFbvGE",
8 | "include_colab_link": true
9 | },
10 | "kernelspec": {
11 | "name": "python3",
12 | "display_name": "Python 3"
13 | },
14 | "language_info": {
15 | "name": "python"
16 | }
17 | },
18 | "cells": [
19 | {
20 | "cell_type": "markdown",
21 | "metadata": {
22 | "id": "view-in-github",
23 | "colab_type": "text"
24 | },
25 | "source": [
26 | "
"
27 | ]
28 | },
29 | {
30 | "cell_type": "markdown",
31 | "source": [
32 | "**Arrays**"
33 | ],
34 | "metadata": {
35 | "id": "JAN7Mu4CBCq2"
36 | }
37 | },
38 | {
39 | "cell_type": "code",
40 | "execution_count": 2,
41 | "metadata": {
42 | "id": "69amf6KJBCL1"
43 | },
44 | "outputs": [],
45 | "source": [
46 | "#Similar to a list, an array is also a data structure which can hold more than one value at a time.\n",
47 | "#However, an array can only hold a collection of ordered elements of the same data type.\n",
48 | "#Here is an intuitive example of an array: Imagine you have a bunch of toy bikes. Each toy is exactly the same, but they are all different colors.\n",
49 | "#You can line them up on a shelf to keep them organized. \n",
50 | "#The shelf would be like an array, and each toy bike would be like an element in the array. Just like how you can identify each toy bike by \n",
51 | "#its position on the shelf,you can identify each element in an array by its position in the array.\n",
52 | "\n",
53 | "#For example, you might have a red toy at the first position, a blue toy Bike at the second position, and a green toy Bike at the third position. \n",
54 | "#In an array, these would be called the first element, second element, and third element, respectively."
55 | ]
56 | },
57 | {
58 | "cell_type": "markdown",
59 | "source": [
60 | "**Examples of Arrays & Lists**\n",
61 | "* Arrays - Examples\n",
62 | "\n",
63 | "* [red, blue, green] is an array of car colors in the above toy car example.
\n",
64 | "[1, 2, 3, 4, 5] is an array of integers.\n",
65 | "[ ‘a’, ‘b’, ‘c’, ‘d’, ‘e’ ] is an array of strings.\n",
66 | "[[ 1 , 2 , 3 , 4],\n",
67 | "[ 5, 6, 7, 8 ]] is a 2 dimensional array.\n",
68 | "\n",
69 | "* Lists - Examples\n",
70 | "\n",
71 | "* [ 1, 2, 3, ‘a’, 5 ] is a list containing both integers and a string.\n",
72 | "* [ 1, 2, 3, 4, ‘b’, [ 1, 2, 3 ] ] is a list containing integers, a string, and another list."
73 | ],
74 | "metadata": {
75 | "id": "D8_xZHceK1DI"
76 | }
77 | },
78 | {
79 | "cell_type": "code",
80 | "source": [
81 | "# Why Arrays?\n",
82 | "#A combination of Arrays, together with Python could save you a lot of time. Arrays help reduce the overall size of your code.\n",
83 | "#List vs Array\n",
84 | "#A list can store different data types such as integers, strings, etc., whereas an array stores only single data type values, i.e., \n",
85 | "#you can only have an array of integers, an array of strings, etc."
86 | ],
87 | "metadata": {
88 | "id": "auizxdN0Mj-8"
89 | },
90 | "execution_count": 3,
91 | "outputs": []
92 | },
93 | {
94 | "cell_type": "markdown",
95 | "source": [
96 | "**Vectors & Matrix**\n",
97 | "```\n",
98 | "Vector\n",
99 | "A vector, in programming, is a type of array that is one-dimensional.\n",
100 | "For example, [1, 2, 3, 4, 5] is a vector.Here's a simple explanation of what it means for a vector to be one-dimensional:\n",
101 | "Imagine you have a box with a bunch of toy cars inside.\n",
102 | "You can think of the box as an array,and each toy car as an element in the array.\n",
103 | "An array is like a list of things that are organized in a specific order.\n",
104 | "Now, imagine that you only have one row of toy cars in your box. This means that the toy cars are all lined up in a single row, \n",
105 | "like this:\n",
106 | "car 1, car 2, car 3, car 4, car 5\n",
107 | "This is a one-dimensional array, or a vector, because there is \n",
108 | "only one row of toy cars. In other words, the array has only one dimension, or direction.\n",
109 | "In contrast, if you had a box with multiple rows of toy cars, like this:\n",
110 | "\n",
111 | "car 1, car 2, car 3 car 4, car 5, car 6 car 7, car 8, car 9\n",
112 | "\n",
113 | "Then this would be a two-dimensional array, because it has two dimensions, or directions (up and down, as well as left and right).\n",
114 | "```\n",
115 | "\n",
116 | "```\n",
117 | "Matrix\n",
118 | "Matrix is an arrangement of numbers into rows and columns.\n",
119 | "\n",
120 | "The matrix A has two rows and three columns.\n",
121 | "With that let's understand Matrices with an intuitively example. \n",
122 | "Imagine you have a box with a bunch of toy cars inside, and you want to organize them into rows and columns.\n",
123 | "You can think of the box as a matrix, and each toy car as an element in the matrix. A matrix is like a table of numbers \n",
124 | "that are organized into rows and columns.\n",
125 | "\n",
126 | "For example, you could have a matrix with three rows and three columns, like this:\n",
127 | "car 1, car 2, car 3 car 4, car 5, car 6 car 7, car 8, car 9\n",
128 | "In this matrix, the first row has three toy cars (car 1, car 2, and car 3),\n",
129 | "the second row has three toy cars (car 4, car 5, and car 6),\n",
130 | "and the third row has three toy cars (car 7, car 8, and car 9).\n",
131 | "Each toy car has a specific position in the matrix, based on its row and column. \n",
132 | "For example, car 5 is in the second row and the second column of the matrix. You can use the row and column indices to identify\n",
133 | "the position of each toy car in the matrix.\n",
134 | "```"
135 | ],
136 | "metadata": {
137 | "id": "bUiTmPo9eJV5"
138 | }
139 | }
140 | ]
141 | }
--------------------------------------------------------------------------------