progster
progster

Reputation: 937

obtain a list of available dataframes in pandas

How can I check the names of available dataframes in pandas?

with a loop I create several dataframes and I would like to check if all the desidered df are created

Upvotes: 1

Views: 64

Answers (1)

shad0w_wa1k3r
shad0w_wa1k3r

Reputation: 13372

Assuming you have DataFrame imported, you can simply do

[name for name, obj in locals().items() if isinstance(obj, DataFrame)]

Upvotes: 3

Related Questions