I am looking for the Python equivalent of numpythe IDL # operator . Here is what # operator does :
numpy
Computes the elements of an array by multiplying the columns of the first array by the rows of the second array. The second array must have the same number of columns, since the first array has rows. The resulting array has the same number of columns as the first array, and the same number of rows as the second array.
Here are the arrays numpyI'm dealing with:
A = [[ 0.9826128 0. 0.18566662] [ 0. 1. 0. ] [-0.18566662 0. 0.9826128 ]]
and
B = [[ 1. 0. 0. ] [ 0.62692564 0.77418869 0.08715574]]
Also numpy.dot(A,B)leads to ValueError: matrices are not aligned.
numpy.dot(A,B)
ValueError: matrices are not aligned
IDL , , :
IDL -
, # :
numpy.dot(A.T, B.T).T
:
import numpy as np A = np.array([[0, 1, 2], [3, 4, 5]]) B = np.array([[0, 1], [2, 3], [4, 5]]) C = np.dot(A.T, B.T).T print(C)
[[ 3 4 5] [ 9 14 19] [15 24 33]]
, .
Source: https://habr.com/ru/post/1536915/More articles:Divide a character by more than 1 word - stringhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1536911/unable-to-cast-object-of-type-systemdatasqlclientsqlinternalconnectiontds-to-type-systemdatasqlclientsqlinternalconnectionsmi&usg=ALkJrhjfDEj2Dau1K1qs4hvhJKp5TznciAComparing SQL strings calculating discrepancies in value - sqlWhy are there so many utilities of objects defined on the constructor rather than the prototype - javascriptSpark: why streaming cannot connect java socket client - apache-sparkJackEx equivalents for simple SQL SELECT statements - javaJoin two tables based on substring from foreign keys (MS SQL2005) - sqlConvert timestamp to date in Laravel? - eloquentGet a list of keys in a HashMap that have a key of type "some value", - javaHow to set top edge of table in iOS? - iosAll Articles