Python pandas.Panel() Examples

The following are 30 code examples for showing how to use pandas.Panel(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may want to check out the right sidebar which shows the related API usage.

You may also want to check out all available functions/classes of the module pandas , or try the search function .

Example 1
Project: MPContribs   Author: materialsproject   File: pre_submission.py    License: MIT License 6 votes vote down vote up
def load_data(file_path):
    d = binarywave.load(file_path)
    dat = d["wave"]["wData"]
    if dat.shape[-1] not in [4, 6]:
        print ("invalid file")
        return
    labels = (
        [
            "Height",
            "Amplitude 1",
            "Amplitude 2",
            "Phase 1",
            "Phase 2",
            "Resonance Frequency",
        ]
        if dat.shape[-1] == 6
        else ["Height", "Amplitude", "Phase", "z sensor"]
    )
    return Panel(dat, minor_axis=labels).transpose(2, 0, 1).to_frame() 
Example 2
Project: MPContribs   Author: materialsproject   File: pre_submission.py    License: MIT License 6 votes vote down vote up
def load_RSM(filename):
    om, tt, psd = xu.io.getxrdml_map(filename)
    om = np.deg2rad(om)
    tt = np.deg2rad(tt)
    wavelength = 1.54056

    q_y = (1 / wavelength) * (np.cos(tt) - np.cos(2 * om - tt))
    q_x = (1 / wavelength) * (np.sin(tt) - np.sin(2 * om - tt))

    xi = np.linspace(np.min(q_x), np.max(q_x), 100)
    yi = np.linspace(np.min(q_y), np.max(q_y), 100)
    psd[psd < 1] = 1
    data_grid = griddata(
        (q_x, q_y), psd, (xi[None, :], yi[:, None]), fill_value=1, method="cubic"
    )
    nx, ny = data_grid.shape

    range_values = [np.min(q_x), np.max(q_x), np.min(q_y), np.max(q_y)]
    output_data = (
        Panel(np.log(data_grid).reshape(nx, ny, 1), minor_axis=["RSM"])
        .transpose(2, 0, 1)
        .to_frame()
    )

    return range_values, output_data 
Example 3
Project: recruit   Author: Frank-qlu   File: test_concat.py    License: Apache License 2.0 6 votes vote down vote up
def test_panel_concat_buglet(self, sort):
        # #2257
        def make_panel():
            index = 5
            cols = 3

            def df():
                return DataFrame(np.random.randn(index, cols),
                                 index=["I%s" % i for i in range(index)],
                                 columns=["C%s" % i for i in range(cols)])
            return Panel({"Item%s" % x: df() for x in ['A', 'B', 'C']})

        panel1 = make_panel()
        panel2 = make_panel()

        panel2 = panel2.rename(major_axis={x: "%s_1" % x
                                           for x in panel2.major_axis})

        panel3 = panel2.rename(major_axis=lambda x: '%s_1' % x)
        panel3 = panel3.rename(minor_axis=lambda x: '%s_1' % x)

        # it works!
        concat([panel1, panel3], axis=1, verify_integrity=True, sort=sort) 
Example 4
Project: recruit   Author: Frank-qlu   File: test_panel.py    License: Apache License 2.0 6 votes vote down vote up
def test_panel_assignment(self):

        with catch_warnings(record=True):
            # GH3777
            wp = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
                       major_axis=date_range('1/1/2000', periods=5),
                       minor_axis=['A', 'B', 'C', 'D'])
            wp2 = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
                        major_axis=date_range('1/1/2000', periods=5),
                        minor_axis=['A', 'B', 'C', 'D'])

            # TODO: unused?
            # expected = wp.loc[['Item1', 'Item2'], :, ['A', 'B']]

            with pytest.raises(NotImplementedError):
                wp.loc[['Item1', 'Item2'], :, ['A', 'B']] = wp2.loc[
                    ['Item1', 'Item2'], :, ['A', 'B']]

            # to_assign = wp2.loc[['Item1', 'Item2'], :, ['A', 'B']]
            # wp.loc[['Item1', 'Item2'], :, ['A', 'B']] = to_assign
            # result = wp.loc[['Item1', 'Item2'], :, ['A', 'B']]
            # tm.assert_panel_equal(result,expected) 
Example 5
Project: recruit   Author: Frank-qlu   File: test_subclass.py    License: Apache License 2.0 6 votes vote down vote up
def test_to_panel_expanddim(self):
        # GH 9762

        class SubclassedFrame(DataFrame):

            @property
            def _constructor_expanddim(self):
                return SubclassedPanel

        class SubclassedPanel(Panel):
            pass

        index = MultiIndex.from_tuples([(0, 0), (0, 1), (0, 2)])
        df = SubclassedFrame({'X': [1, 2, 3], 'Y': [4, 5, 6]}, index=index)
        result = df.to_panel()
        assert isinstance(result, SubclassedPanel)
        expected = SubclassedPanel([[[1, 2, 3]], [[4, 5, 6]]],
                                   items=['X', 'Y'], major_axis=[0],
                                   minor_axis=[0, 1, 2],
                                   dtype='int64')
        tm.assert_panel_equal(result, expected) 
Example 6
Project: recruit   Author: Frank-qlu   File: test_time_grouper.py    License: Apache License 2.0 6 votes vote down vote up
def test_panel_aggregation():
    ind = pd.date_range('1/1/2000', periods=100)
    data = np.random.randn(2, len(ind), 4)

    wp = Panel(data, items=['Item1', 'Item2'], major_axis=ind,
               minor_axis=['A', 'B', 'C', 'D'])

    tg = TimeGrouper('M', axis=1)
    _, grouper, _ = tg._get_grouper(wp)
    bingrouped = wp.groupby(grouper)
    binagg = bingrouped.mean()

    def f(x):
        assert (isinstance(x, Panel))
        return x.mean(1)

    result = bingrouped.agg(f)
    tm.assert_panel_equal(result, binagg) 
Example 7
Project: recruit   Author: Frank-qlu   File: test_datetime_index.py    License: Apache License 2.0 6 votes vote down vote up
def test_resample_panel_numpy():
    rng = date_range('1/1/2000', '6/30/2000')
    n = len(rng)

    with catch_warnings(record=True):
        panel = Panel(np.random.randn(3, n, 5),
                      items=['one', 'two', 'three'],
                      major_axis=rng,
                      minor_axis=['a', 'b', 'c', 'd', 'e'])

        result = panel.resample('M', axis=1).apply(lambda x: x.mean(1))
        expected = panel.resample('M', axis=1).mean()
        tm.assert_panel_equal(result, expected)

        panel = panel.swapaxes(1, 2)
        result = panel.resample('M', axis=2).apply(lambda x: x.mean(2))
        expected = panel.resample('M', axis=2).mean()
        tm.assert_panel_equal(result, expected) 
Example 8
Project: vnpy_crypto   Author: birforce   File: test_base.py    License: MIT License 6 votes vote down vote up
def test_binary_ops_docs(self):
        from pandas import DataFrame, Panel
        op_map = {'add': '+',
                  'sub': '-',
                  'mul': '*',
                  'mod': '%',
                  'pow': '**',
                  'truediv': '/',
                  'floordiv': '//'}
        for op_name in ['add', 'sub', 'mul', 'mod', 'pow', 'truediv',
                        'floordiv']:
            for klass in [Series, DataFrame, Panel]:
                operand1 = klass.__name__.lower()
                operand2 = 'other'
                op = op_map[op_name]
                expected_str = ' '.join([operand1, op, operand2])
                assert expected_str in getattr(klass, op_name).__doc__

                # reverse version of the binary ops
                expected_str = ' '.join([operand2, op, operand1])
                assert expected_str in getattr(klass, 'r' + op_name).__doc__ 
Example 9
Project: vnpy_crypto   Author: birforce   File: test_label_or_level_utils.py    License: MIT License 6 votes vote down vote up
def test_drop_labels_or_levels_series(df):

    # Make series with L1 as index
    s = df.set_index('L1').L2
    assert_levels_dropped(s, ['L1'], axis=0)

    with tm.assert_raises_regex(ValueError, "not valid labels or levels"):
        s._drop_labels_or_levels('L4', axis=0)

    # Make series with L1 and L2 as index
    s = df.set_index(['L1', 'L2']).L3
    assert_levels_dropped(s, ['L1', 'L2'], axis=0)

    with tm.assert_raises_regex(ValueError, "not valid labels or levels"):
        s._drop_labels_or_levels('L4', axis=0)


# Panel
# ----- 
Example 10
Project: vnpy_crypto   Author: birforce   File: test_panel.py    License: MIT License 6 votes vote down vote up
def test_panel_assignment(self):

        with catch_warnings(record=True):
            # GH3777
            wp = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
                       major_axis=date_range('1/1/2000', periods=5),
                       minor_axis=['A', 'B', 'C', 'D'])
            wp2 = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
                        major_axis=date_range('1/1/2000', periods=5),
                        minor_axis=['A', 'B', 'C', 'D'])

            # TODO: unused?
            # expected = wp.loc[['Item1', 'Item2'], :, ['A', 'B']]

            def f():
                wp.loc[['Item1', 'Item2'], :, ['A', 'B']] = wp2.loc[
                    ['Item1', 'Item2'], :, ['A', 'B']]

            pytest.raises(NotImplementedError, f)

            # to_assign = wp2.loc[['Item1', 'Item2'], :, ['A', 'B']]
            # wp.loc[['Item1', 'Item2'], :, ['A', 'B']] = to_assign
            # result = wp.loc[['Item1', 'Item2'], :, ['A', 'B']]
            # tm.assert_panel_equal(result,expected) 
Example 11
Project: vnpy_crypto   Author: birforce   File: test_subclass.py    License: MIT License 6 votes vote down vote up
def test_to_panel_expanddim(self):
        # GH 9762

        with catch_warnings(record=True):
            class SubclassedFrame(DataFrame):

                @property
                def _constructor_expanddim(self):
                    return SubclassedPanel

            class SubclassedPanel(Panel):
                pass

            index = MultiIndex.from_tuples([(0, 0), (0, 1), (0, 2)])
            df = SubclassedFrame({'X': [1, 2, 3], 'Y': [4, 5, 6]}, index=index)
            result = df.to_panel()
            assert isinstance(result, SubclassedPanel)
            expected = SubclassedPanel([[[1, 2, 3]], [[4, 5, 6]]],
                                       items=['X', 'Y'], major_axis=[0],
                                       minor_axis=[0, 1, 2],
                                       dtype='int64')
            tm.assert_panel_equal(result, expected) 
Example 12
Project: Computable   Author: ktraunmueller   File: test_resample.py    License: MIT License 6 votes vote down vote up
def test_resample_panel(self):
        rng = date_range('1/1/2000', '6/30/2000')
        n = len(rng)

        panel = Panel(np.random.randn(3, n, 5),
                      items=['one', 'two', 'three'],
                      major_axis=rng,
                      minor_axis=['a', 'b', 'c', 'd', 'e'])

        result = panel.resample('M', axis=1)

        def p_apply(panel, f):
            result = {}
            for item in panel.items:
                result[item] = f(panel[item])
            return Panel(result, items=panel.items)

        expected = p_apply(panel, lambda x: x.resample('M'))
        tm.assert_panel_equal(result, expected)

        panel2 = panel.swapaxes(1, 2)
        result = panel2.resample('M', axis=2)
        expected = p_apply(panel2, lambda x: x.resample('M', axis=1))
        tm.assert_panel_equal(result, expected) 
Example 13
Project: Computable   Author: ktraunmueller   File: test_resample.py    License: MIT License 6 votes vote down vote up
def test_resample_panel_numpy(self):
        rng = date_range('1/1/2000', '6/30/2000')
        n = len(rng)

        panel = Panel(np.random.randn(3, n, 5),
                      items=['one', 'two', 'three'],
                      major_axis=rng,
                      minor_axis=['a', 'b', 'c', 'd', 'e'])

        result = panel.resample('M', how=lambda x: x.mean(1), axis=1)
        expected = panel.resample('M', how='mean', axis=1)
        tm.assert_panel_equal(result, expected)

        panel = panel.swapaxes(1, 2)
        result = panel.resample('M', how=lambda x: x.mean(2), axis=2)
        expected = panel.resample('M', how='mean', axis=2)
        tm.assert_panel_equal(result, expected) 
Example 14
Project: Computable   Author: ktraunmueller   File: test_resample.py    License: MIT License 6 votes vote down vote up
def test_panel_aggregation(self):
        ind = pd.date_range('1/1/2000', periods=100)
        data = np.random.randn(2, len(ind), 4)
        wp = pd.Panel(data, items=['Item1', 'Item2'], major_axis=ind,
                      minor_axis=['A', 'B', 'C', 'D'])

        tg = TimeGrouper('M', axis=1)
        grouper = tg.get_grouper(wp)
        bingrouped = wp.groupby(grouper)
        binagg = bingrouped.mean()

        def f(x):
            assert(isinstance(x, Panel))
            return x.mean(1)
        result = bingrouped.agg(f)
        tm.assert_panel_equal(result, binagg) 
Example 15
Project: Computable   Author: ktraunmueller   File: data.py    License: MIT License 6 votes vote down vote up
def _dl_mult_symbols(symbols, start, end, chunksize, retry_count, pause,
                     method):
    stocks = {}
    for sym_group in _in_chunks(symbols, chunksize):
        for sym in sym_group:
            try:
                stocks[sym] = method(sym, start, end, retry_count, pause)
            except IOError:
                warnings.warn('Failed to read symbol: {0!r}, replacing with '
                              'NaN.'.format(sym), SymbolWarning)
                stocks[sym] = np.nan

    try:
        return Panel(stocks).swapaxes('items', 'minor')
    except AttributeError:
        # cannot construct a panel with just 1D nans indicating no data
        raise RemoteDataError("No data fetched using "
                              "{0!r}".format(method.__name__)) 
Example 16
Project: recipy   Author: recipy   File: run_pandas.py    License: Apache License 2.0 6 votes vote down vote up
def get_panel(self):
        """
        Return a Panel consisting of two DataFrames, each consisting
        of two Series, each created using get_series.

        :return: Panel
        :rtype: pandas.Panel
        """
        data1 = {'seriesOne': self.get_series(0, 5),
                 'seriesTwo': self.get_series(0, 5, 10)}
        frame1 = pd.DataFrame(data1)
        data2 = {'seriesThree': self.get_series(6, 10),
                 'seriesFour': self.get_series(6, 10, 10)}
        frame2 = pd.DataFrame(data2)
        data = {'frameOne': frame1, 'frameTwo': frame2}
        return pd.Panel(data) 
Example 17
def test_panel_concat_buglet(self, sort):
        # #2257
        def make_panel():
            index = 5
            cols = 3

            def df():
                return DataFrame(np.random.randn(index, cols),
                                 index=["I%s" % i for i in range(index)],
                                 columns=["C%s" % i for i in range(cols)])
            return Panel({"Item%s" % x: df() for x in ['A', 'B', 'C']})

        panel1 = make_panel()
        panel2 = make_panel()

        panel2 = panel2.rename(major_axis={x: "%s_1" % x
                                           for x in panel2.major_axis})

        panel3 = panel2.rename(major_axis=lambda x: '%s_1' % x)
        panel3 = panel3.rename(minor_axis=lambda x: '%s_1' % x)

        # it works!
        concat([panel1, panel3], axis=1, verify_integrity=True, sort=sort) 
Example 18
def test_panel_assignment(self):

        with catch_warnings(record=True):
            # GH3777
            wp = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
                       major_axis=date_range('1/1/2000', periods=5),
                       minor_axis=['A', 'B', 'C', 'D'])
            wp2 = Panel(np.random.randn(2, 5, 4), items=['Item1', 'Item2'],
                        major_axis=date_range('1/1/2000', periods=5),
                        minor_axis=['A', 'B', 'C', 'D'])

            # TODO: unused?
            # expected = wp.loc[['Item1', 'Item2'], :, ['A', 'B']]

            with pytest.raises(NotImplementedError):
                wp.loc[['Item1', 'Item2'], :, ['A', 'B']] = wp2.loc[
                    ['Item1', 'Item2'], :, ['A', 'B']]

            # to_assign = wp2.loc[['Item1', 'Item2'], :, ['A', 'B']]
            # wp.loc[['Item1', 'Item2'], :, ['A', 'B']] = to_assign
            # result = wp.loc[['Item1', 'Item2'], :, ['A', 'B']]
            # tm.assert_panel_equal(result,expected) 
Example 19
def test_to_panel_expanddim(self):
        # GH 9762

        class SubclassedFrame(DataFrame):

            @property
            def _constructor_expanddim(self):
                return SubclassedPanel

        class SubclassedPanel(Panel):
            pass

        index = MultiIndex.from_tuples([(0, 0), (0, 1), (0, 2)])
        df = SubclassedFrame({'X': [1, 2, 3], 'Y': [4, 5, 6]}, index=index)
        result = df.to_panel()
        assert isinstance(result, SubclassedPanel)
        expected = SubclassedPanel([[[1, 2, 3]], [[4, 5, 6]]],
                                   items=['X', 'Y'], major_axis=[0],
                                   minor_axis=[0, 1, 2],
                                   dtype='int64')
        tm.assert_panel_equal(result, expected) 
Example 20
def test_panel_aggregation():
    ind = pd.date_range('1/1/2000', periods=100)
    data = np.random.randn(2, len(ind), 4)

    wp = Panel(data, items=['Item1', 'Item2'], major_axis=ind,
               minor_axis=['A', 'B', 'C', 'D'])

    tg = TimeGrouper('M', axis=1)
    _, grouper, _ = tg._get_grouper(wp)
    bingrouped = wp.groupby(grouper)
    binagg = bingrouped.mean()

    def f(x):
        assert (isinstance(x, Panel))
        return x.mean(1)

    result = bingrouped.agg(f)
    tm.assert_panel_equal(result, binagg) 
Example 21
def test_resample_panel_numpy():
    rng = date_range('1/1/2000', '6/30/2000')
    n = len(rng)

    with catch_warnings(record=True):
        panel = Panel(np.random.randn(3, n, 5),
                      items=['one', 'two', 'three'],
                      major_axis=rng,
                      minor_axis=['a', 'b', 'c', 'd', 'e'])

        result = panel.resample('M', axis=1).apply(lambda x: x.mean(1))
        expected = panel.resample('M', axis=1).mean()
        tm.assert_panel_equal(result, expected)

        panel = panel.swapaxes(1, 2)
        result = panel.resample('M', axis=2).apply(lambda x: x.mean(2))
        expected = panel.resample('M', axis=2).mean()
        tm.assert_panel_equal(result, expected) 
Example 22
Project: OpenTrader   Author: OpenTrading   File: Omlette.py    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
def vAppendHdf(self, sKey, gData, gMetaData=None):
        oHdfStore = self.oHdfStore
        if oHdfStore is None: return
        
        if gData is None:
            # we need to check if the key exists
            pass
            # drop through
        # assert sCat in ['recipe', 'feed'], "ERROR: unrecognized category: " +sCat
        elif type(gData) in [pandas.Series, pandas.DataFrame, pandas.Panel]:
            self.oFd.write("INFO: HDF putting " +sKey +'\n')
            oHdfStore.put('/' +sKey, gData,
                          format='table',
                          data_columns=True)
            oHdfStore.flush()
        else:
            self.oFd.write("ERROR: unsupported datatype for %s: %r \n" % \
                           (sKey, type(gData),))
            return
        
        if gMetaData is None:
            return
        if type(gMetaData) in [dict, OrderedDict]:
            # o = getattr(getattr(oHdfStore.root, sCat), sInst)
            o = oHdfStore.get_node('/'+sKey)
            o._v_attrs.metadata = [gMetaData]
            oHdfStore.flush() 
Example 23
Project: arctic   Author: man-group   File: _pandas_ndarray_store.py    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
def can_write_type(data):
        return isinstance(data, Panel) 
Example 24
Project: arctic   Author: man-group   File: _pandas_ndarray_store.py    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
def append(self, arctic_lib, version, symbol, item, previous_version, **kwargs):
        raise ValueError('Appending not supported for pandas.Panel') 
Example 25
Project: arctic   Author: man-group   File: test_pandas_store.py    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
def panel(i1, i2, i3):
    return Panel(np.random.randn(i1, i2, i3), range(i1), ['A%d' % i for i in range(i2)],
                 list(rrule(DAILY, count=i3, dtstart=dt(1970, 1, 1), interval=1))) 
Example 26
Project: arctic   Author: man-group   File: test_pandas_store.py    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
def test_panel_save_read_with_nans(library):
    '''Ensure that nan rows are not dropped when calling to_frame.'''
    df1 = DataFrame(data=np.arange(4).reshape((2, 2)), index=['r1', 'r2'], columns=['c1', 'c2'])
    df2 = DataFrame(data=np.arange(6).reshape((3, 2)), index=['r1', 'r2', 'r3'], columns=['c1', 'c2'])
    p_in = Panel(data=dict(i1=df1, i2=df2))

    library.write('pandas', p_in)
    p_out = library.read('pandas').data

    assert p_in.shape == p_out.shape
    # check_names is False because pandas helpfully names the axes for us.
    assert_frame_equal(p_in.iloc[0], p_out.iloc[0], check_names=False)
    assert_frame_equal(p_in.iloc[1], p_out.iloc[1], check_names=False) 
Example 27
Project: recruit   Author: Frank-qlu   File: test_multilevel.py    License: Apache License 2.0 5 votes vote down vote up
def test_swaplevel_panel(self):
        with catch_warnings(record=True):
            simplefilter("ignore", FutureWarning)
            panel = Panel({'ItemA': self.frame, 'ItemB': self.frame * 2})
            expected = panel.copy()
            expected.major_axis = expected.major_axis.swaplevel(0, 1)

            for result in (panel.swaplevel(axis='major'),
                           panel.swaplevel(0, axis='major'),
                           panel.swaplevel(0, 1, axis='major')):
                tm.assert_panel_equal(result, expected) 
Example 28
Project: recruit   Author: Frank-qlu   File: test_concat.py    License: Apache License 2.0 5 votes vote down vote up
def test_concat_invalid(self):

        # trying to concat a ndframe with a non-ndframe
        df1 = mkdf(10, 2)
        msg = ('cannot concatenate object of type "{}";'
               ' only pd.Series, pd.DataFrame, and pd.Panel'
               r' \(deprecated\) objs are valid')
        for obj in [1, dict(), [1, 2], (1, 2)]:
            with pytest.raises(TypeError, match=msg.format(type(obj))):
                concat([df1, obj]) 
Example 29
Project: recruit   Author: Frank-qlu   File: test_generic.py    License: Apache License 2.0 5 votes vote down vote up
def test_head_tail(self):
        # GH5370

        o = self._construct(shape=10)

        # check all index types
        for index in [tm.makeFloatIndex, tm.makeIntIndex, tm.makeStringIndex,
                      tm.makeUnicodeIndex, tm.makeDateIndex,
                      tm.makePeriodIndex]:
            axis = o._get_axis_name(0)
            setattr(o, axis, index(len(getattr(o, axis))))

            # Panel + dims
            try:
                o.head()
            except (NotImplementedError):
                pytest.skip('not implemented on {0}'.format(
                    o.__class__.__name__))

            self._compare(o.head(), o.iloc[:5])
            self._compare(o.tail(), o.iloc[-5:])

            # 0-len
            self._compare(o.head(0), o.iloc[0:0])
            self._compare(o.tail(0), o.iloc[0:0])

            # bounded
            self._compare(o.head(len(o) + 1), o)
            self._compare(o.tail(len(o) + 1), o)

            # neg index
            self._compare(o.head(-3), o.head(7))
            self._compare(o.tail(-3), o.tail(7)) 
Example 30
Project: recruit   Author: Frank-qlu   File: test_generic.py    License: Apache License 2.0 5 votes vote down vote up
def test_pipe_panel(self):
        with catch_warnings(record=True):
            simplefilter("ignore", FutureWarning)
            wp = Panel({'r1': DataFrame({"A": [1, 2, 3]})})
            f = lambda x, y: x + y
            result = wp.pipe(f, 2)
            expected = wp + 2
            assert_panel_equal(result, expected)

            result = wp.pipe((f, 'y'), x=1)
            expected = wp + 1
            assert_panel_equal(result, expected)

            with pytest.raises(ValueError):
                wp.pipe((f, 'y'), x=1, y=1)