i"m getting this error: TypeError: object() takes no parameters [closed]

时间秒杀一切 提交于 2020-02-05 04:01:49

问题


I'm getting this error:

TypeError: object() takes no parameters

My code:

import numpy as np
import pandas as pd
data = np.random.rand(2, 4, 5)
p = pd.Panel(data)

I expect the output:

<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 4 (major_axis) x 5 (minor_axis)
Items axis: 0 to 1
Major_axis axis: 0 to 3
Minor_axis axis: 0 to 4

回答1:


If you are using a recent version of pandas, you will find that Panel has been removed.

Panel was removed in 0.25.0. For prior documentation, see the 0.24 documentation

This Stack Overflow post explains the recommended alternative.



来源:https://stackoverflow.com/questions/57711312/im-getting-this-error-typeerror-object-takes-no-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!