问题
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