當前位置: 首頁>>代碼示例>>Python>>正文


Python _validators.validate_axis_style_args方法代碼示例

本文整理匯總了Python中pandas.util._validators.validate_axis_style_args方法的典型用法代碼示例。如果您正苦於以下問題:Python _validators.validate_axis_style_args方法的具體用法?Python _validators.validate_axis_style_args怎麽用?Python _validators.validate_axis_style_args使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pandas.util._validators的用法示例。


在下文中一共展示了_validators.validate_axis_style_args方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: reindex

# 需要導入模塊: from pandas.util import _validators [as 別名]
# 或者: from pandas.util._validators import validate_axis_style_args [as 別名]
def reindex(self, *args, **kwargs):
        major = kwargs.pop("major", None)
        minor = kwargs.pop('minor', None)

        if major is not None:
            if kwargs.get("major_axis"):
                raise TypeError("Cannot specify both 'major' and 'major_axis'")
            kwargs['major_axis'] = major
        if minor is not None:
            if kwargs.get("minor_axis"):
                raise TypeError("Cannot specify both 'minor' and 'minor_axis'")

            kwargs['minor_axis'] = minor
        axes = validate_axis_style_args(self, args, kwargs, 'labels',
                                        'reindex')
        kwargs.update(axes)
        kwargs.pop('axis', None)
        kwargs.pop('labels', None)

        with warnings.catch_warnings():
            warnings.simplefilter("ignore", FutureWarning)
            # do not warn about constructing Panel when reindexing
            result = super(Panel, self).reindex(**kwargs)
        return result 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:26,代碼來源:panel.py

示例2: reindex

# 需要導入模塊: from pandas.util import _validators [as 別名]
# 或者: from pandas.util._validators import validate_axis_style_args [as 別名]
def reindex(self, *args, **kwargs):
        major = kwargs.pop("major", None)
        minor = kwargs.pop('minor', None)

        if major is not None:
            if kwargs.get("major_axis"):
                raise TypeError("Cannot specify both 'major' and 'major_axis'")
            kwargs['major_axis'] = major
        if minor is not None:
            if kwargs.get("minor_axis"):
                raise TypeError("Cannot specify both 'minor' and 'minor_axis'")

            kwargs['minor_axis'] = minor
        axes = validate_axis_style_args(self, args, kwargs, 'labels',
                                        'reindex')
        kwargs.update(axes)
        kwargs.pop('axis', None)
        kwargs.pop('labels', None)
        return super(Panel, self).reindex(**kwargs) 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:21,代碼來源:panel.py

示例3: reindex

# 需要導入模塊: from pandas.util import _validators [as 別名]
# 或者: from pandas.util._validators import validate_axis_style_args [as 別名]
def reindex(self, *args, **kwargs):
        major = kwargs.pop("major", None)
        minor = kwargs.pop('minor', None)

        if major is not None:
            if kwargs.get("major_axis"):
                raise TypeError("Cannot specify both 'major' and 'major_axis'")
            kwargs['major_axis'] = major
        if minor is not None:
            if kwargs.get("minor_axis"):
                raise TypeError("Cannot specify both 'minor' and 'minor_axis'")

            kwargs['minor_axis'] = minor
        axes = validate_axis_style_args(self, args, kwargs, 'labels',
                                        'reindex')
        if self.ndim >= 4:
            # Hack for PanelND
            axes = {}
        kwargs.update(axes)
        kwargs.pop('axis', None)
        kwargs.pop('labels', None)
        return super(Panel, self).reindex(**kwargs) 
開發者ID:nccgroup,項目名稱:Splunking-Crime,代碼行數:24,代碼來源:panel.py

示例4: panel4d_reindex

# 需要導入模塊: from pandas.util import _validators [as 別名]
# 或者: from pandas.util._validators import validate_axis_style_args [as 別名]
def panel4d_reindex(self, labs=None, labels=None, items=None, major_axis=None,
                    minor_axis=None, axis=None, **kwargs):
    # Hack for reindex_axis deprecation
    # Ha, we used labels for two different things
    # I think this will work still.
    if labs is None:
        args = ()
    else:
        args = (labs,)
    kwargs_ = dict(labels=labels,
                   items=items,
                   major_axis=major_axis,
                   minor_axis=minor_axis,
                   axis=axis)
    kwargs_ = {k: v for k, v in kwargs_.items() if v is not None}
    # major = kwargs.pop("major", None)
    # minor = kwargs.pop('minor', None)

    # if major is not None:
    #     if kwargs.get("major_axis"):
    #         raise TypeError("Cannot specify both 'major' and 'major_axis'")
    #     kwargs_['major_axis'] = major
    # if minor is not None:
    #     if kwargs.get("minor_axis"):
    #         raise TypeError("Cannot specify both 'minor' and 'minor_axis'")
    #     kwargs_['minor_axis'] = minor

    if axis is not None:
        kwargs_['axis'] = axis

    axes = validate_axis_style_args(self, args, kwargs_, 'labs', 'reindex')
    kwargs.update(axes)
    return NDFrame.reindex(self, **kwargs) 
開發者ID:nccgroup,項目名稱:Splunking-Crime,代碼行數:35,代碼來源:panel4d.py


注:本文中的pandas.util._validators.validate_axis_style_args方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。