当前位置: 首页>>代码示例>>Python>>正文


Python Series.name方法代码示例

本文整理汇总了Python中pandas.Series.name方法的典型用法代码示例。如果您正苦于以下问题:Python Series.name方法的具体用法?Python Series.name怎么用?Python Series.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.Series的用法示例。


在下文中一共展示了Series.name方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: describe

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def describe(self):
        """
        Describes this Categorical

        Returns
        -------
        description: `DataFrame`
            A dataframe with frequency and counts by category.
        """
        counts = self.value_counts(dropna=False)
        freqs = counts / float(counts.sum())

        from pandas.core.reshape.concat import concat
        result = concat([counts, freqs], axis=1)
        result.columns = ['counts', 'freqs']
        result.index.name = 'categories'

        return result 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:20,代码来源:categorical.py

示例2: _reduce

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _reduce(self, op, name, axis=0, skipna=True, numeric_only=None,
                filter_type=None, **kwds):
        """ perform the reduction type operation if we can """
        func = getattr(self, name, None)
        if func is None:
            raise TypeError("{klass} cannot perform the operation {op}".format(
                            klass=self.__class__.__name__, op=name))
        return func(**kwds) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:10,代码来源:base.py

示例3: _reduce

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _reduce(self, name, axis=0, **kwargs):
        func = getattr(self, name, None)
        if func is None:
            msg = 'Categorical cannot perform the operation {op}'
            raise TypeError(msg.format(op=name))
        return func(**kwargs) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:8,代码来源:categorical.py

示例4: __init__

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def __init__(self, data):
        self._validate(data)
        self._parent = data.values
        self._index = data.index
        self._name = data.name
        self._freeze() 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:8,代码来源:categorical.py

示例5: _delegate_property_get

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _delegate_property_get(self, name):
        return getattr(self._parent, name) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:categorical.py

示例6: _delegate_property_set

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _delegate_property_set(self, name, new_values):
        return setattr(self._parent, name, new_values) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:4,代码来源:categorical.py

示例7: name

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def name(self):
        # Note: Upon deprecation, `test_tab_completion_with_categorical` will
        # need to be updated. `name` will need to be removed from
        # `ok_for_cat`.
        warn("`Series.cat.name` has been deprecated. Use `Series.name` "
             "instead.",
             FutureWarning,
             stacklevel=2)
        return self._name 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:11,代码来源:categorical.py

示例8: _selection_name

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _selection_name(self):
        """
        return a name for myself; this would ideally be called
        the 'name' property, but we cannot conflict with the
        Series.name property which can be set
        """
        if self._selection is None:
            return None  # 'result'
        else:
            return self._selection 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:12,代码来源:base.py

示例9: _reduce

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _reduce(self, op, name, axis=0, skipna=True, numeric_only=None,
                filter_type=None, **kwds):
        """ perform the reduction type operation if we can """
        func = getattr(self, name, None)
        if func is None:
            raise TypeError("{klass} cannot perform the operation {op}".format(
                            klass=self.__class__.__name__, op=name))
        return func(skipna=skipna, **kwds) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:base.py

示例10: _dispatch

# 需要导入模块: from pandas import Series [as 别名]
# 或者: from pandas.Series import name [as 别名]
def _dispatch(name, *args, **kwargs):
        """ dispatch to apply """

        def outer(self, *args, **kwargs):
            def f(x):
                x = self._shallow_copy(x, groupby=self._groupby)
                return getattr(x, name)(*args, **kwargs)
            return self._groupby.apply(f)
        outer.__name__ = name
        return outer 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:12,代码来源:base.py


注:本文中的pandas.Series.name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。