Python Program #35 - Multiply Two Matrix in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ค. 2023
  • Python Program #35 - Multiply Two Matrix in Python
    In this video by Programming for beginners we will see Python Program to Multiply Two Matrix in Python for beginners series.
    Python programming language and program is very easy to learn for students and professionals.
    Multiplication of two matrix X and Y is defined only if the number of columns in X is equal to the number of rows Y.
    If X is a n x m matrix and Y is a m x l matrix then, XY is defined and has the dimension n x l (but YX is not defined).
    ==========
    Python Programs for Beginners Playlist:
    • Python Programs
    Python Tutorial for Beginners Playlist:
    • Python Tutorial
    Java Tutorial for Beginners Playlist:
    • Java Tutorial
    All Java Programs Playlist:
    • Java Programs
    Python is a computer programming language often used to build websites and software, automate tasks, and conduct data analysis. Python is a general-purpose language, meaning it can be used to create a variety of different programs and isn't specialized for any specific problems.
    It is very important for students and professionals to learn python programming language that will help you to achieve many tasks easily and to build softwares.
    TH-cam Gears:
    Microphone: amzn.to/3iIk5K3
    Mouse: amzn.to/35irmNF
    Laptop: amzn.to/3iG0jyD
    #PythonTutorial #PythonProgram #PythonForBeginners #Programming #PythonTutorialForBeginners
    ============================
    LIKE | SHARE | COMMENT | SUBSCRIBE
    Thanks for watching :)

ความคิดเห็น • 29

  • @QuickPodcastBites
    @QuickPodcastBites หลายเดือนก่อน +1

    same as chat gbt
    good job

  • @UnknownGuyInTheInternet
    @UnknownGuyInTheInternet 9 หลายเดือนก่อน +1

    Thank you bro u helped me a lot 😅

  • @marypal4359
    @marypal4359 6 หลายเดือนก่อน +1

    thank you soooo much

  • @bubblebath2892
    @bubblebath2892 4 หลายเดือนก่อน +1

    Nice explanation bro thnks a ton

  • @user-cm7xm6gr1n
    @user-cm7xm6gr1n 5 หลายเดือนก่อน +1

    thank you

  • @x_5044
    @x_5044 9 หลายเดือนก่อน +1

    Thanks

  • @samisado6331
    @samisado6331 6 หลายเดือนก่อน +1

    Is it normal that I couldn't solve it at all? I found it very difficult.. by the way thanks a lot , you've really helped me..

  • @snowfly11
    @snowfly11 9 หลายเดือนก่อน +1

    Nice❤

  • @yashbisht4507
    @yashbisht4507 3 หลายเดือนก่อน +1

    if we want to input data of matrix from user so how it is done please reply

    • @programmingforbeginners7392
      @programmingforbeginners7392  3 หลายเดือนก่อน

      you can use the input function
      watch this video:
      th-cam.com/video/sjA5O6Xoetc/w-d-xo.html

  • @austinberman
    @austinberman 2 หลายเดือนก่อน +1

    i tried this myself and i came across a problem i don’t understand, is says name error: name ‘result’ is not defined, what does that mean 😅

    • @PriyansuRajak
      @PriyansuRajak 2 หลายเดือนก่อน

      You missed to define result
      You are printing result without defining it
      1stly define it.

  • @popsicle1809
    @popsicle1809 หลายเดือนก่อน +1

    Dude, just a tip. I am not an native english speaker, so if you could talk just a little bit slower, it would be great.

    • @programmingforbeginners7392
      @programmingforbeginners7392  หลายเดือนก่อน

      Yes sure.. will improve.. thanks for your suggestion
      For now you can decrease the video speed and watch

  • @jjaattiinnrathore2664
    @jjaattiinnrathore2664 6 หลายเดือนก่อน +2

    still cant do it 😥

    • @del_f_s_1051
      @del_f_s_1051 6 หลายเดือนก่อน +1

      This is the python code:
      from numpy import
      m1= matrix("1 2 3;4 5 6;7 8 9")
      m2 = matrix("11,12,13;14,15,16;17,18,19")
      #multiplication
      #only possible when the num of rows in m2 is equal to num of column in m3
      '''
      It looks like this
      m1 = [1 2 3
      4 5 6
      7 8 9]
      m2 = [[11 12 13
      14 15 16
      17 18 19]]
      elements of m1 row1 will multiply to the elemts of m2 columnn1 and the sum will be the first element of the output
      m2 row 1 = 1 2 3
      m3 column 1 = 11 14 17
      cal = 1*11+2*14+3*17=90 (1st row 1st element)
      m2 row 1 = 1 2 3
      m3 column 2 = 12 15 18
      cal = 1*12+2*15+3*18=96 (1st row 2nd element)
      m2 row 1 = 1 2 3
      m3 column 3 = 13 16 19
      cal = 1*13+2*16+3*19=102 (1st row 3rd element)
      m2 row 2 = 4 5 6
      m3 column 1 = 11 14 17
      cal = 4*11+3*14+6*17=216 (2nd row 1st element)
      m2 row 2 = 4 5 6
      m3 column 2 = 12 15 18
      cal = 4*12+5*15+6*18=231 (2nd row 2nd element)
      m2 row 2 = 4 5 6
      m3 column 3 = 13 16 19
      cal = 4*13+5*16+6*19=246 (2nd row 3rd column)
      m2 row 3 = 7 8 9
      m3 column 1 = 11 14 17
      cal = 7*11+8*14+9*17=342 (3rd row first element)
      #try applying the logic for and do it for row 3 element 2 and 3
      output = [[ 90 96 102]
      [216 231 246]
      [342 366 390]]
      '''
      mmul = m2 * m3
      print (mmul)
      Hope u understand... At first even I couldn't get the logic

    • @programmingforbeginners7392
      @programmingforbeginners7392  6 หลายเดือนก่อน

      please pause video and practice 2-3 times to understand properly

  • @AshishMishraK
    @AshishMishraK 2 หลายเดือนก่อน

    I am getting index out of range error with the same code.

  • @austinberman
    @austinberman 2 หลายเดือนก่อน

    i tried this myself and i came across a problem i don’t understand, is says name error: name ‘result’ is not defined, what does that mean 😅

    • @kushagraSingh-tz9uo
      @kushagraSingh-tz9uo 2 หลายเดือนก่อน

      did u make the third matrice called result?
      (as shown in the video)