我创建了很多对象名称,超过 500 个对象。
好吧,我的问题是:我如何查看创建的对象或如何清除空间,以便我可以在目录上节省一些空间。
或者
它不会影响我的存储吗?
我创建了很多对象名称,超过 500 个对象。
好吧,我的问题是:我如何查看创建的对象或如何清除空间,以便我可以在目录上节省一些空间。
或者
它不会影响我的存储吗?
扩展迈克的回答:
## create some variables/objects
a = 5
b = 10
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randint(1,100, size=(4,2)), columns=list('AB'))
print(a,b,'\n', df)
## check
%who
# >>> a b df np pd
#%%% Delete all
## clear with prompt
%reset
## clear without confirmation prompt
%reset -f
# check
%who
#%%% Delete specific
#%%%% %reset_selective <regular_expression>
## clear with prompt
%reset_selective df
## clear without prompt
%reset_selective -f df
# multiple
%reset_selective -f [a,b]
# %reset_selective -f a,b << doesn't work
## check
%who
#%%%% del
# clears without prompt
del a
## multiple
del [a,b]
# or
del a,b
## check
%who