File: panel_methods.py

package info (click to toggle)
pandas 0.23.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 167,704 kB
  • sloc: python: 230,826; ansic: 11,317; sh: 682; makefile: 133
file content (24 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import warnings

import numpy as np

from .pandas_vb_common import Panel, setup  # noqa


class PanelMethods(object):

    goal_time = 0.2
    params = ['items', 'major', 'minor']
    param_names = ['axis']

    def setup(self, axis):
        with warnings.catch_warnings(record=True):
            self.panel = Panel(np.random.randn(100, 1000, 100))

    def time_pct_change(self, axis):
        with warnings.catch_warnings(record=True):
            self.panel.pct_change(1, axis=axis)

    def time_shift(self, axis):
        with warnings.catch_warnings(record=True):
            self.panel.shift(1, axis=axis)