|
29 | 29 | is_dict_like, is_extension_array_dtype, is_integer, is_list_like,
|
30 | 30 | is_number, is_numeric_dtype, is_object_dtype, is_period_arraylike,
|
31 | 31 | is_re_compilable, is_scalar, is_timedelta64_dtype, pandas_dtype)
|
32 |
| -from pandas.core.dtypes.generic import ABCDataFrame, ABCPanel, ABCSeries |
| 32 | +from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries |
33 | 33 | from pandas.core.dtypes.inference import is_hashable
|
34 | 34 | from pandas.core.dtypes.missing import isna, notna
|
35 | 35 |
|
@@ -688,7 +688,7 @@ def transpose(self, *args, **kwargs):
|
688 | 688 | if kwargs.pop('copy', None) or (len(args) and args[-1]):
|
689 | 689 | new_values = new_values.copy()
|
690 | 690 |
|
691 |
| - nv.validate_transpose_for_generic(self, kwargs) |
| 691 | + nv.validate_transpose(tuple(), kwargs) |
692 | 692 | return self._constructor(new_values, **new_axes).__finalize__(self)
|
693 | 693 |
|
694 | 694 | def swapaxes(self, axis1, axis2, copy=True):
|
@@ -978,7 +978,7 @@ def rename(self, *args, **kwargs):
|
978 | 978 | ----------
|
979 | 979 | %(axes)s : scalar, list-like, dict-like or function, optional
|
980 | 980 | Scalar or list-like will alter the ``Series.name`` attribute,
|
981 |
| - and raise on DataFrame or Panel. |
| 981 | + and raise on DataFrame. |
982 | 982 | dict-like or functions are transformations to apply to
|
983 | 983 | that axis' values
|
984 | 984 | copy : bool, default True
|
@@ -1852,16 +1852,14 @@ def __iter__(self):
|
1852 | 1852 | def keys(self):
|
1853 | 1853 | """Get the 'info axis' (see Indexing for more)
|
1854 | 1854 |
|
1855 |
| - This is index for Series, columns for DataFrame and major_axis for |
1856 |
| - Panel. |
| 1855 | + This is index for Series, columns for DataFrame. |
1857 | 1856 | """
|
1858 | 1857 | return self._info_axis
|
1859 | 1858 |
|
1860 | 1859 | def iteritems(self):
|
1861 | 1860 | """Iterate over (label, values) on info axis
|
1862 | 1861 |
|
1863 |
| - This is index for Series, columns for DataFrame, major_axis for Panel, |
1864 |
| - and so on. |
| 1862 | + This is index for Series, columns for DataFrame and so on. |
1865 | 1863 | """
|
1866 | 1864 | for h in self._info_axis:
|
1867 | 1865 | yield h, self[h]
|
@@ -3063,8 +3061,9 @@ def _create_indexer(cls, name, indexer):
|
3063 | 3061 |
|
3064 | 3062 | def get(self, key, default=None):
|
3065 | 3063 | """
|
3066 |
| - Get item from object for given key (DataFrame column, Panel slice, |
3067 |
| - etc.). Returns default value if not found. |
| 3064 | + Get item from object for given key (ex: DataFrame column). |
| 3065 | +
|
| 3066 | + Returns default value if not found. |
3068 | 3067 |
|
3069 | 3068 | Parameters
|
3070 | 3069 | ----------
|
@@ -4091,8 +4090,7 @@ def sort_values(self, by=None, axis=0, ascending=True, inplace=False,
|
4091 | 4090 | 0 A 2 0
|
4092 | 4091 | 1 A 1 1
|
4093 | 4092 | """
|
4094 |
| - raise NotImplementedError("sort_values has not been implemented " |
4095 |
| - "on Panel or Panel4D objects.") |
| 4093 | + raise AbstractMethodError(self) |
4096 | 4094 |
|
4097 | 4095 | def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
|
4098 | 4096 | kind='quicksort', na_position='last', sort_remaining=True):
|
@@ -4770,7 +4768,7 @@ def sample(self, n=None, frac=None, replace=False, weights=None,
|
4770 | 4768 | object.
|
4771 | 4769 | axis : int or string, optional
|
4772 | 4770 | Axis to sample. Accepts axis number or name. Default is stat axis
|
4773 |
| - for given data type (0 for Series and DataFrames, 1 for Panels). |
| 4771 | + for given data type (0 for Series and DataFrames). |
4774 | 4772 |
|
4775 | 4773 | Returns
|
4776 | 4774 | -------
|
@@ -4853,7 +4851,7 @@ def sample(self, n=None, frac=None, replace=False, weights=None,
|
4853 | 4851 | "a DataFrame")
|
4854 | 4852 | else:
|
4855 | 4853 | raise ValueError("Strings cannot be passed as weights "
|
4856 |
| - "when sampling from a Series or Panel.") |
| 4854 | + "when sampling from a Series.") |
4857 | 4855 |
|
4858 | 4856 | weights = pd.Series(weights, dtype='float64')
|
4859 | 4857 |
|
@@ -5697,8 +5695,7 @@ def astype(self, dtype, copy=True, errors='raise', **kwargs):
|
5697 | 5695 | elif self.ndim > 2:
|
5698 | 5696 | raise NotImplementedError(
|
5699 | 5697 | 'astype() only accepts a dtype arg of type dict when '
|
5700 |
| - 'invoked on Series and DataFrames. A single dtype must be ' |
5701 |
| - 'specified when invoked on a Panel.' |
| 5698 | + 'invoked on Series and DataFrames.' |
5702 | 5699 | )
|
5703 | 5700 | for col_name in dtype.keys():
|
5704 | 5701 | if col_name not in self:
|
@@ -5751,7 +5748,7 @@ def copy(self, deep=True):
|
5751 | 5748 |
|
5752 | 5749 | Returns
|
5753 | 5750 | -------
|
5754 |
| - copy : Series, DataFrame or Panel |
| 5751 | + copy : Series or DataFrame |
5755 | 5752 | Object type matches caller.
|
5756 | 5753 |
|
5757 | 5754 | Notes
|
@@ -6822,8 +6819,7 @@ def interpolate(self, method='linear', axis=0, limit=None, inplace=False,
|
6822 | 6819 | inplace = validate_bool_kwarg(inplace, 'inplace')
|
6823 | 6820 |
|
6824 | 6821 | if self.ndim > 2:
|
6825 |
| - raise NotImplementedError("Interpolate has not been implemented " |
6826 |
| - "on Panel and Panel 4D objects.") |
| 6822 | + raise NotImplementedError("Interpolate has not been implemented ") |
6827 | 6823 |
|
6828 | 6824 | if axis == 0:
|
6829 | 6825 | ax = self._info_axis_name
|
@@ -7326,9 +7322,6 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False,
|
7326 | 7322 | 3 6 8
|
7327 | 7323 | 4 5 3
|
7328 | 7324 | """
|
7329 |
| - if isinstance(self, ABCPanel): |
7330 |
| - raise NotImplementedError("clip is not supported yet for panels") |
7331 |
| - |
7332 | 7325 | inplace = validate_bool_kwarg(inplace, 'inplace')
|
7333 | 7326 |
|
7334 | 7327 | axis = nv.validate_clip_with_axis(axis, args, kwargs)
|
@@ -9824,10 +9817,7 @@ def describe(self, percentiles=None, include=None, exclude=None):
|
9824 | 9817 | 75% NaN 2.5
|
9825 | 9818 | max NaN 3.0
|
9826 | 9819 | """
|
9827 |
| - if self.ndim >= 3: |
9828 |
| - msg = "describe is not implemented on Panel objects." |
9829 |
| - raise NotImplementedError(msg) |
9830 |
| - elif self.ndim == 2 and self.columns.size == 0: |
| 9820 | + if self.ndim == 2 and self.columns.size == 0: |
9831 | 9821 | raise ValueError("Cannot describe a DataFrame without columns")
|
9832 | 9822 |
|
9833 | 9823 | if percentiles is not None:
|
|
0 commit comments