list variables in memory using function in python

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


list variables in memory using function in python



I would like to create a utility function that filters variables in my current environment and prints them (ie print all variables that have type pd.core.frame.DataFrame) and then put this function in my utils module. I used (Pandas Get a List Of All Data Frames loaded into memory):


pd.core.frame.DataFrame


import pandas as pd
def list_my_frames():
f = [var for var in dir() if isinstance(eval(var), pd.core.frame.DataFrame)]
return f



I would like to be able to pass my current environment to dir() so that I can use it outside of my utils module. How can I get a handle to my current environment in python?


dir()









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

r Xa S8fhmaNq8 z0fLc,QgFWYGUP3PYeEUkqL1xv ZYkZDAAhPulvoLHJ3CzRN,tY3N
Iv M9Kks Xqo JjQ,vl xFtqxVMHZcNvU3Uwo0RuBXv41AiovMXgK,HzzkH Sw lqbBD5

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

415 Unsupported Media Type while sending json file over REST Template