Reputation: 249
I am working with spyder and have the Python version: 3.5.2 Anaconda custom (64-bit)
At the beginning I import all libraries I need:
import numpy as np
import os
import matplotlib.pyplot as plt
import pandas as pd
specify the path and upload the dataset:
os.chdir('C:\\Users\\...\\Data_Preprocessing')
dataset = pd.read_csv('Data.csv')
I can observe my dataset in variable explorer window. But when I try to create the matrix of my independent variables with commands like:
X = dataset.ix[:, :-1].values
or
X = dataset.iloc[:, :-1].values
I get:
Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users...\lib\threading.py", line 914, in _bootstrap_inner self.run() File "C:\Users...\lib\site-packages\spyderlib\widgets\externalshell\monitor.py", line 569, in run self.update_remote_view() File "C:\Users...\lib\site-packages\spyderlib\widgets\externalshell\monitor.py", line 450, in update_remote_view remote_view = make_remote_view(ns, settings, more_excluded_names) File "C:\Users...\lib\site-packages\spyderlib\widgets\externalshell\monitor.py", line 79, in make_remote_view minmax=settings['minmax']) File "C:\Users...\lib\site-packages\spyderlib\widgets\dicteditorutils.py", line 225, in value_to_display return display UnboundLocalError: local variable 'display' referenced before assignment
I can still calculate all what I need, but I do not observe created variables in variable explorer. How can I observe them and Why is it happening?
Upvotes: 1
Views: 153
Reputation: 34156
(Spyder developer here) This is a bug and it was fixed in Spyder 2.3.9. Please update to fix it.
Upvotes: 1