Skip to content

Commit

Permalink
remove Panel from doc-strings, catch internal warning on Panel constr…
Browse files Browse the repository at this point in the history
…uction
  • Loading branch information
jreback committed Apr 7, 2017
1 parent 85fc7d4 commit b6fe33b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,9 @@ def f(arg, *args, **kwargs):
If False then only matching columns between self and other will be used
and the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the
output will be a Panel in the case of DataFrame inputs. In the case of
missing elements, only complete pairwise observations will be used.
output will be a MultiIndexed DataFrame in the case of DataFrame
inputs. In the case of missing elements, only complete pairwise
observations will be used.
ddof : int, default 1
Delta Degrees of Freedom. The divisor used in calculations
is ``N - ddof``, where ``N`` represents the number of elements.""")
Expand Down Expand Up @@ -964,11 +965,12 @@ def _get_cov(X, Y):
other : Series, DataFrame, or ndarray, optional
if not supplied then will default to self and produce pairwise output
pairwise : bool, default None
If False then only matching columns between self and other will be used
and the output will be a DataFrame.
If False then only matching columns between self and other will be
used and the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the
output will be a Panel in the case of DataFrame inputs. In the case of
missing elements, only complete pairwise observations will be used.""")
output will be a MultiIndex DataFrame in the case of DataFrame inputs.
In the case of missing elements, only complete pairwise observations
will be used.""")

def corr(self, other=None, pairwise=None, **kwargs):
if other is None:
Expand Down Expand Up @@ -1397,8 +1399,9 @@ def _constructor(self):
If False then only matching columns between self and other will be used and
the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the output
will be a Panel in the case of DataFrame inputs. In the case of missing
elements, only complete pairwise observations will be used.
will be a MultiIndex DataFrame in the case of DataFrame inputs.
In the case of missing elements, only complete pairwise observations will
be used.
bias : boolean, default False
Use a standard estimation bias correction
"""
Expand Down Expand Up @@ -1708,11 +1711,12 @@ def dataframe_from_int_dict(data, frame_template):
# TODO: not the most efficient (perf-wise)
# though not bad code-wise
from pandas import Panel, MultiIndex, Index
p = Panel.from_dict(results).swapaxes('items', 'major')
if len(p.major_axis) > 0:
p.major_axis = arg1.columns[p.major_axis]
if len(p.minor_axis) > 0:
p.minor_axis = arg2.columns[p.minor_axis]
with warnings.catch_warnings(record=True):
p = Panel.from_dict(results).swapaxes('items', 'major')
if len(p.major_axis) > 0:
p.major_axis = arg1.columns[p.major_axis]
if len(p.minor_axis) > 0:
p.minor_axis = arg2.columns[p.minor_axis]

if len(p.items):
result = pd.concat(
Expand Down

0 comments on commit b6fe33b

Please sign in to comment.