def add(*args):
if len(set([tuple([len(item) for item in arg]) for arg in args])) == 1:
return [[sum(b) for *b, in zip(*item,)] for item in [b for *b, in zip(*args,)]]
else:
raise ValueError('Matrices of different shapes.')
Last active
September 2, 2020 12:44
-
-
Save nebelgrau77/1825e02f177303942df27259224cf51f to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment