Skip to content Skip to sidebar Skip to footer

Pycharm Community 3.1.1 And Numpy, "'matrix' Is Not Callable", But The Code Works

I have the following code: import numpy as np if __name__ == '__main__': m = np.matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) print(m) T

Solution 1:

A simple workaround, at least until the bug is fixed, is to use np.mat(...) instead of np.matrix(...).

However, note that np.mat will avoid making copies if the input is already a matrix and so you can't use it to do things like make defensive copies.

Post a Comment for "Pycharm Community 3.1.1 And Numpy, "'matrix' Is Not Callable", But The Code Works"