Newly-assignmed variables not showing up in Spyder's variable explorer

大兔子大兔子 提交于 2019-12-12 10:59:13

问题


I'm writing Python on Spyder. Please see my code below:

import pandas as pd

data = pd.io.excel.read_excel('Data.xls')
CMT_column = data['CMT']

"data" contains a column called "CMT." What I'm trying to do is create a variable called "CMT_column" that contains the values of the "CMT" column.

Here's the problem. After I run the code, only "data" appears in the variable explorer. "CMT_column" is not there. But if I call "CMT_column" in the IPython console, it shows the values of "CMT" as expected. So I guess the variable has been created after all, but why is it not visible in the variable explore?

Thanks in advance for any help.


回答1:


Go to Variable explorer window.

Then you have options button right hand side.

Click on it,Untick the option Exclude all uppercase preferences as shown in image.




回答2:


It seems that Spyder's variable explorer does not like variables with upper case: try rewriting CMT_ as cmt_.



来源:https://stackoverflow.com/questions/31526983/newly-assignmed-variables-not-showing-up-in-spyders-variable-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!