Quantcast
Browsing latest articles
Browse All 4 View Live

Answer by BenedictWilkins for Print all variables defined in one Jupyter cell

So, this was a tough nut to crack. Essentially we are just trying to grab all of the lines in the current cell and extract the variables. As it turns out, we cannot use the global variables defined by...

View Article


Answer by Joe T. Boka for Print all variables defined in one Jupyter cell

You can try something like this, using the inspect library.import inspectk = 0.0417g = 0.829lx = 6.6m = k*g*lx**2def get_name(lst=[]): local_vars = inspect.currentframe().f_back.f_locals.items() for i...

View Article


Answer by umutto for Print all variables defined in one Jupyter cell

You can use whos command to see all variables stored in the current kernel.k, g, lx = .4, .8, 6.6m = k*g*lx**2whosoutputs:Variable Type Data/Info-----------------------------g float 0.8k float 0.4lx...

View Article

Image may be NSFW.
Clik here to view.

Print all variables defined in one Jupyter cell

Is there an easier way to display the name and the value of all variables defined in a single cell in a pretty way?The way I'm doing now is like this, but I waste a lot of time when there are 30...

View Article
Browsing latest articles
Browse All 4 View Live