Skip to content

Commit 3df0abe

Browse files
committed
remove Panel from doc-strings, catch internal warning on Panel construction
1 parent 755606d commit 3df0abe

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

pandas/core/window.py

+17-13
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,9 @@ def f(arg, *args, **kwargs):
927927
If False then only matching columns between self and other will be used
928928
and the output will be a DataFrame.
929929
If True then all pairwise combinations will be calculated and the
930-
output will be a Panel in the case of DataFrame inputs. In the case of
931-
missing elements, only complete pairwise observations will be used.
930+
output will be a MultiIndexed DataFrame in the case of DataFrame
931+
inputs. In the case of missing elements, only complete pairwise
932+
observations will be used.
932933
ddof : int, default 1
933934
Delta Degrees of Freedom. The divisor used in calculations
934935
is ``N - ddof``, where ``N`` represents the number of elements.""")
@@ -964,11 +965,12 @@ def _get_cov(X, Y):
964965
other : Series, DataFrame, or ndarray, optional
965966
if not supplied then will default to self and produce pairwise output
966967
pairwise : bool, default None
967-
If False then only matching columns between self and other will be used
968-
and the output will be a DataFrame.
968+
If False then only matching columns between self and other will be
969+
used and the output will be a DataFrame.
969970
If True then all pairwise combinations will be calculated and the
970-
output will be a Panel in the case of DataFrame inputs. In the case of
971-
missing elements, only complete pairwise observations will be used.""")
971+
output will be a MultiIndex DataFrame in the case of DataFrame inputs.
972+
In the case of missing elements, only complete pairwise observations
973+
will be used.""")
972974

973975
def corr(self, other=None, pairwise=None, **kwargs):
974976
if other is None:
@@ -1397,8 +1399,9 @@ def _constructor(self):
13971399
If False then only matching columns between self and other will be used and
13981400
the output will be a DataFrame.
13991401
If True then all pairwise combinations will be calculated and the output
1400-
will be a Panel in the case of DataFrame inputs. In the case of missing
1401-
elements, only complete pairwise observations will be used.
1402+
will be a MultiIndex DataFrame in the case of DataFrame inputs.
1403+
In the case of missing elements, only complete pairwise observations will
1404+
be used.
14021405
bias : boolean, default False
14031406
Use a standard estimation bias correction
14041407
"""
@@ -1708,11 +1711,12 @@ def dataframe_from_int_dict(data, frame_template):
17081711
# TODO: not the most efficient (perf-wise)
17091712
# though not bad code-wise
17101713
from pandas import Panel, MultiIndex, Index
1711-
p = Panel.from_dict(results).swapaxes('items', 'major')
1712-
if len(p.major_axis) > 0:
1713-
p.major_axis = arg1.columns[p.major_axis]
1714-
if len(p.minor_axis) > 0:
1715-
p.minor_axis = arg2.columns[p.minor_axis]
1714+
with warnings.catch_warnings(record=True):
1715+
p = Panel.from_dict(results).swapaxes('items', 'major')
1716+
if len(p.major_axis) > 0:
1717+
p.major_axis = arg1.columns[p.major_axis]
1718+
if len(p.minor_axis) > 0:
1719+
p.minor_axis = arg2.columns[p.minor_axis]
17161720

17171721
if len(p.items):
17181722
result = pd.concat(

0 commit comments

Comments
 (0)