Aan de slagBegin gratis

Matrix multiplication part II

Let's put your matrix multiplication skills to the test.

Deze oefening maakt deel uit van de cursus

Building Recommendation Engines with PySpark

Bekijk cursus

Oefeninstructies

  • Use the .shape attribute to understand the dimensions of matrices C and D, and determine whether these two matrices can be multiplied together or not.
  • If they can be multiplied, use the np.matmul() method to multiply them. If not, set C_times_D to None.

Interactieve oefening met praktijkervaring

Probeer deze oefening door deze voorbeeldcode aan te vullen.

# Print the dimensions of C
print(____.____)

# Print the dimensions of D
print(____.____)

# Can C and D be multiplied together?
C_times_D = ____
Code bewerken en uitvoeren