[英]Jupyter notebook magic command - use %who DataFrame to get list of DataFrames?
I can print all interactive variables, with some minimal formatting using %who
.我可以使用
%who
以最小的格式打印所有交互式变量。
If I only want defined DataFrames, %who DataFrame
works great.如果我只想要定义的 DataFrames,
%who DataFrame
效果很好。
Is there a way to send the output of %who DataFrame
to a list?有没有办法将
%who DataFrame
的输出发送到列表?
I believe %who_ls
is what you're looking for:我相信
%who_ls
是你要找的:
Return a sorted list of all interactive variables.
返回所有交互变量的排序列表。
If arguments are given, only variables of types matching these arguments are returned.如果给出参数,则仅返回与这些参数匹配的类型的变量。
Example use -示例使用 -
In [1]: x, y, z = 1, 1, 1
In [2]: ints = %who_ls int
In [3]: print(ints)
['x', 'y', 'z']
您想使用此命令将 who 的输出放入变量中:
df_list = %who_ls DataFrame
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.