1
+ {
2
+ "nbformat" : 4 ,
3
+ "nbformat_minor" : 0 ,
4
+ "metadata" : {
5
+ "colab" : {
6
+ "name" : " Python Matrices.ipynb" ,
7
+ "provenance" : [],
8
+ "authorship_tag" : " ABX9TyMLi612WitaVmks/oye9y7r" ,
9
+ "include_colab_link" : true
10
+ },
11
+ "kernelspec" : {
12
+ "name" : " python3" ,
13
+ "display_name" : " Python 3"
14
+ },
15
+ "language_info" : {
16
+ "name" : " python"
17
+ }
18
+ },
19
+ "cells" : [
20
+ {
21
+ "cell_type" : " markdown" ,
22
+ "metadata" : {
23
+ "id" : " view-in-github" ,
24
+ "colab_type" : " text"
25
+ },
26
+ "source" : [
27
+ " <a href=\" https://colab.research.google.com/github/natnew/100-Python-Projects/blob/main/Python_Matrices.ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type" : " code" ,
32
+ "execution_count" : 1 ,
33
+ "metadata" : {
34
+ "id" : " WP8x2EnjJp-7"
35
+ },
36
+ "outputs" : [],
37
+ "source" : [
38
+ " # import the important module in python\n " ,
39
+ " import numpy as np\n " ,
40
+ " \n "
41
+ ]
42
+ },
43
+ {
44
+ "cell_type" : " code" ,
45
+ "source" : [
46
+ " # make matrix with numpy\n " ,
47
+ " snan = np.matrix('[64, 1; 12, 3]')\n " ,
48
+ " \n " ,
49
+ " # applying matrix.max() method\n " ,
50
+ " nat = snan.max()\n " ,
51
+ " \n " ,
52
+ " print(nat)"
53
+ ],
54
+ "metadata" : {
55
+ "colab" : {
56
+ "base_uri" : " https://localhost:8080/"
57
+ },
58
+ "id" : " n493u4JNJtas" ,
59
+ "outputId" : " a6668f81-db6a-4eb2-af58-7224f9cb97a4"
60
+ },
61
+ "execution_count" : 2 ,
62
+ "outputs" : [
63
+ {
64
+ "output_type" : " stream" ,
65
+ "name" : " stdout" ,
66
+ "text" : [
67
+ " 64\n "
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "cell_type" : " code" ,
74
+ "source" : [
75
+ " # make matrix with numpy\n " ,
76
+ " val = [['Natasha',101,90,95], ['John',102,85,100], ['Sara',103,90,95]]\n " ,
77
+ " \n " ,
78
+ " #print values at a given index (list)\n " ,
79
+ " print(val[2])\n " ,
80
+ " \n " ,
81
+ " #print values at a given index (index in list)\n " ,
82
+ " print(val[0][1])"
83
+ ],
84
+ "metadata" : {
85
+ "colab" : {
86
+ "base_uri" : " https://localhost:8080/"
87
+ },
88
+ "id" : " fY-zD77KJ36B" ,
89
+ "outputId" : " 788f07de-bd9f-4f3e-ff68-f59008bf7181"
90
+ },
91
+ "execution_count" : 4 ,
92
+ "outputs" : [
93
+ {
94
+ "output_type" : " stream" ,
95
+ "name" : " stdout" ,
96
+ "text" : [
97
+ " ['Sara', 103, 90, 95]\n " ,
98
+ " 101\n "
99
+ ]
100
+ }
101
+ ]
102
+ }
103
+ ]
104
+ }
0 commit comments