Issue in new version spyder 4.1

53 views
Skip to first unread message

Bibeesh Y S

unread,
May 18, 2020, 6:08:52 PM5/18/20
to spyder
Hey all,

I need a clarification, why this spyder new version not able identify a dataframe which is already exists in variable explorer

this is my script

import pandas as pd

a=input("Enter Y/N:")
if a=="Y":
    DataFrame=pd.DataFrame()
    print ("Empty Data Frame created")    
print(DataFrame)

if i execute this script with "Y" condition im able to print empty DataFrame  ( mean while DataFrame is stored in variable explorer)  - It works
then if i execute line 5 alone "print(DataFrame)" - It works

But if execute the hole script again with "N" condition im getting "NameError: name 'DataFrame' is not defined" on line 5

same script works in old version 3.1 but not working in new version

Regards
Bibeesh


Brian Olsen

unread,
May 19, 2020, 11:18:03 PM5/19/20
to spyd...@googlegroups.com
To restore the previous behaviour please select the run option to run the file in a the console namepace instead of a new one.



--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/c770dae4-da8f-46b9-8fb9-028a14cb603a%40googlegroups.com.

Bibeesh Y S

unread,
May 24, 2020, 3:13:10 PM5/24/20
to spyder
Thanks, it works :)
Reply all
Reply to author
Forward
0 new messages