https://stackoverflow.com/questions/45853595/spyder-clear-variable-explorer-along-with-variables-from-memory
In Spyder, Do following steps Run Configuration per file...Clear all variables before execution [Select Checkbox] This actually clears variables from previous run of the file. Hope it helps.