當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。