在python中使用pandas时出错

2024-05-20 14:17:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用python的pandas包。有些功能可以工作,但是当我试图将“include”参数传递到descripe()函数时,我得到一个错误:

train_df.describe(include=['O'])

完整代码如下所示:

^{pr2}$

我得到以下错误:

>> python survival.py
Traceback (most recent call last):
File "survival.py", line 10, in <module>
train_df.describe(include=['O'])
TypeError: describe() got an unexpected keyword argument 'include'

单独使用.describe()似乎是可行的。有什么想法吗?谢谢您。在


Tags: 函数代码py功能mostpandasdfinclude