|
|
|
|
|
by aceperry
2197 days ago
|
|
I got stumped at the Frobenius norm (11/13). Everything I typed in returned this: NotImplementedError: the 'axis' parameter is currently not supported on line 7 I used variations of:
np.sqrt(m.sum(m.prod()))
np.sqrt(m.sum(m2)) It's been a long time since I've taken linear algebra, so I don't remember some of these operations. |
|
So it should look something like this: `np.sqrt((m * * 2).sum())`
Re: The error message, it looks like it's occurring because `sum` doesn't normally take any parameters and interprets the argument as an "axis" parameter — https://numpy.org/doc/1.18/reference/generated/numpy.sum.htm...
Order of operations is tricky and I could do a better job breaking it down. Still plan to add the Show Solution button but need to get some sleep :-).
In the meantime you can see all the possible solutions in the repo! https://github.com/vthommeret/mathtocode/tree/master/questio...
[0] Remove the space between the asterisks / I had to add it since HN interprets them as italics.