简体   繁体   English

如何找出熊猫数据框的功能?

[英]How to find out features of a pandas Data Frame?

My question is theoretical. 我的问题是理论上的。 Let's suppose I have a pandas Data Frame in python and I want to check what are the operations which can be performed on it. 假设我在python中有一个pandas数据框,我想检查可以对其执行的操作。 For eg we can perform rename, sum, mean etc. on a pandas data frame. 例如,我们可以对熊猫数据框执行重命名,求和,平均值等。 But is there any command which will give me the complete list of these kind of operations? 但是,有没有什么命令可以给我这些操作的完整清单?

You can always use dir command and check all available functions :) 您可以始终使用dir命令并检查所有可用功能:)

Example: 例: 在此处输入图片说明

You can use the command dir to inspect your dataframe - 您可以使用命令dir检查您的数据框-

df = pd.DataFrame([[1, 2, 'a']], columns =['A', 'B', 'C'])
for d in dir(df)[:10]: print (d)

Output (first 10 lines) - 输出(前10行)-

A
B
C
T
_AXIS_ALIASES
_AXIS_IALIASES
_AXIS_LEN
_AXIS_NAMES
_AXIS_NUMBERS
_AXIS_ORDERS

See more about dir here 在这里查看有关dir更多信息

Well I think there isn't a command to list all available commands, but you can install a basic Python Extension to help you out. 好吧,我认为这里没有列出所有可用命令的命令,但是您可以安装基本的Python扩展来帮助您。

If you are using VS Code or Atom just go to Extension Marketplace, there are bunch of them from you can choose. 如果您使用的是VS Code或Atom,请直接转到Extension Marketplace,可以从中选择一堆。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM