I'm new in Python and also in Spyder, so please forgive my silly questions.

I want to see all the variables, matrices and arrays in the variable explorer. It shows me everything except the matrices. For example if I run a = array([1,2,3,4]), then I see it as expected in the variable explorer. After I run b = mat(a) or b = asmatrix (a), I cannot see b in the variable explorer. However the b is stored and

>>> b
matrix([[1, 2, 3, 4]])

In the Spyder documentation I didn't find anything to expect matrices not to appear there. Must the matrices show up in the variable explorer or not? And if yes, how can I do that?

有帮助吗?

解决方案

(Spyder dev here) The problem is quite simple: Spyder doesn't have support to show all types of objects in its Variable Explorer. We only support lists, dictionaries, numpy arrays, numbers and strings, if I remember correctly. You have discovered one important type (i.e. matrices), others are Pandas DataFrames and Series, which we should really add.

Edit: Numpy matrices, along with Pandas DataFrames and Series are shown and can be edited through the Variable Explorer since version 2.3.1.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top