5

since I am not finding anything on google related to my "problem" I ask you all here. I am using the Spyder IDE for scientific coding with Python 3.7, my problem is spider does not showing data frame variable in variable explorer. for example :

 word_mi_information.append([average, max_mi, class_name[max_index], vocab_list[w_index]])
    
word_mi_information = sorted(word_mi_information, key=lambda x: x[0], reverse=True)

preview3 = pd.DataFrame(word_mi_information)
preview3.columns=['mutual information(MI)', 'main class MI', 'main_class', 'word']

preview3.head(10)

#the expected output 


    Info Gain                 main class        info main_class                                 word
0   4473.658680600584   24124.9834859362     ('C:/Users/user/Desktop/Akhbarona\\Tech', '', '')  هتف
1   4154.761699928653   20292.13826441525   ('C:/Users/user/Desktop/Akhbarona\\Tech', '', '')   خدم
2   4082.1526400011394  21332.74626781158   ('C:/Users/user/Desktop/Akhbarona\\Tech', '', '')   شرك
3   3907.930114110117   7164.627960061558   ('C:/Users/user/Desktop/Akhbarona\\Politics', '', '')   غرب
4   3487.537345717307   17568.034002235207  ('C:/Users/user/Desktop/Akhbarona\\Medical', '', '')    جسم
5   3469.0442804650042  17593.549747242403  ('C:/Users/user/Desktop/Akhbarona\\Medical', '', '')    نول
6   3398.1096950558563  17168.788976051695  ('C:/Users/user/Desktop/Akhbarona\\Medical', '', '')    صحة
7   3392.971784676107   17108.75969342166   ('C:/Users/user/Desktop/Akhbarona\\Medical', '', '')    مرض
8   3237.043207698965   15843.821383151355  ('C:/Users/user/Desktop/Akhbarona\\Tech', '', '')   جهز
9   2923.039707389109   24649.83000746686   ('C:/Users/user/Desktop/Akhbarona\\Religion', '', '')   الل
10  2896.6926629600543  15641.256964593376  ('C:/Users/user/Desktop/Akhbarona\\Tech', '', '')   ذكة
  • 2
    Needs a small example to demonstrate what the specific problem is for the question to be answerable – paisanco Sep 19 '20 at 19:23
  • Please see [How to provide a reproducible copy of your DataFrame using `df.head(30).to_clipboard(sep=',')`](https://stackoverflow.com/questions/52413246), then **[edit] your question**, and paste the clipboard into a code block. Always provide a [mre] **with code, data, errors, current output, and expected output, as text**. Only plot images are okay. – Trenton McKinney Sep 19 '20 at 19:35
  • actually I don't have errors, I just want to show data frame variable in variable explorer to show output –  Sep 19 '20 at 19:42
  • I give you the expected output –  Sep 19 '20 at 19:46
  • How can anyone answer the question without the initial data? – Trenton McKinney Sep 19 '20 at 19:47
  • sorry @TrentonMcKinney I give the expected output –  Sep 19 '20 at 19:49

3 Answers3

9

You can try the following: select the "Preferences" option in Spyder and there the "Variable explorer" option. Try unchecking the different options. It worked for me on visualization and filtering.

David Buck
  • 3,752
  • 35
  • 31
  • 35
  • this was what I was looking for in the first place when I had the same question. @user14203379 could you mark this as solved if this was also your solution? – Konrad Bauer Oct 05 '22 at 00:53
  • I had to uncheck "Exclude callables and modules" to get any variables (ints, strings, etc.) to show in the Variable Explorer. – Joe Dec 13 '22 at 15:41
0

I answered what I think is the same question here.

I'm assuming you mean the variable explorer frame stays empty instead of displaying all the variables? You need to make sure the correct version of spyder-kernels is installed in the environment Spyder is install in. From the link:

Spyder Spyder-Kernels
4.0.0-4.0.1 1.8.1
4.1.0-4.1.2 1.9.0
4.1.3 1.9.1
4.1.4 1.9.3
4.1.5-4.1.6 1.9.4
4.2.0 1.10.0
5.0.0-5.0.5 2.0.5
5.1.0-5.1.5 2.1.3
5.2.0-5.2.1 2.2.0
5.2.2 2.2.1

If using conda:

conda activate ENVIRONEMENT-NAME
conda install spyder-kernels=<VERSION>

If not using conda, activate the environment however you usually would and run:

pip install spyder-kernels==<VERSION>
ambitiousdonut
  • 384
  • 5
  • 10
-1

I had the same problem. the first thing I tried and luckily worked was using the factory reset. SELECT 'tools' and you will see 'reset Spyder to factory defaults'. Hope that works for you too.