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.
Refresh while code is running To trigger a refresh, simply click the reload button on the Variable Explorer toolbar, or press the shortcut Ctrl+R ( Cmd-R ) when it has focus.
Go to View/Panes and select Variable Explorer. Save this answer. Show activity on this post. Save this answer.
To see them all, double click the list to open a viewer that will display the index, type, size and value of each element of the list. Just like dictionaries, you can double-click values to edit them.
The Variable Explorer shows the namespace contents (all global object references, such as variables, functions, modules, etc.) of the currently selected IPython Console session, and allows you to interact with them through a variety of GUI-based editors.
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.
It seems that Spyder's variable explorer does not like variables with upper case: try rewriting CMT_ as cmt_.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With